cellEig

Below is a demonstration of the features of the cellEig function

Contents

Syntax

[V,D]=cellEig(C);

Description

Computes eigenvalues and eigenvectors for each matrix contained in the cell array C, i.e. [v,d]=eig(c) is executed for each cell entry. The output is two cell arrays, i.e. the cell V containing the eigenvectors and the cell D containing the eigenvalues.

Examples

clear; close all; clc;

Example: Calculating eigenvalues for matrices contained in cells

Creating example cell containing two matrices

M1=rand(3,3);
M1=M1*M1';
M2=rand(5,5);
M2=M2*M2';

C={M1,M2};
[V,D]=cellEig(C);

Contained in the output cells are the eigenvectors and eigenvalues of each of the matrices e.g. for the first

v1=V{1}
d1=D{1}
v1 =

    0.7299    0.2764    0.6251
   -0.6643    0.0718    0.7440
    0.1608   -0.9584    0.2360


d1 =

    0.0110         0         0
         0    0.1437         0
         0         0    1.7436

and the second entry

v2=V{2}
d2=D{2}
v2 =

    0.2989   -0.7303    0.3787    0.0256    0.4829
   -0.8602   -0.1367   -0.1222    0.2436    0.4087
    0.1298    0.0242   -0.6122   -0.6226    0.4693
    0.3902    0.1856   -0.4108    0.7354    0.3222
    0.0392    0.6426    0.5461   -0.1080    0.5251


d2 =

    0.0004         0         0         0         0
         0    0.1759         0         0         0
         0         0    0.4777         0         0
         0         0         0    1.1689         0
         0         0         0         0    4.8385

GIBBON www.gibboncode.org

Kevin Mattheus Moerman, [email protected]

GIBBON footer text

License: https://github.com/gibbonCode/GIBBON/blob/master/LICENSE

GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for image segmentation, image-based modeling, meshing, and finite element analysis.

Copyright (C) 2019 Kevin Mattheus Moerman

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.