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.4122    0.4603    0.7863
   -0.8997    0.0695    0.4310
    0.1437   -0.8850    0.4428


d1 =

    0.0013         0         0
         0    0.2310         0
         0         0    1.6728

and the second entry

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

   -0.2128    0.2770   -0.1366   -0.6280    0.6819
    0.1801   -0.7084   -0.6420    0.0169    0.2309
    0.6980   -0.1035    0.4903    0.1441    0.4908
   -0.1816    0.3792   -0.2995    0.7476    0.4178
   -0.6341   -0.5166    0.4890    0.1601    0.2573


d2 =

    0.0019         0         0         0         0
         0    0.0434         0         0         0
         0         0    0.1076         0         0
         0         0         0    0.4085         0
         0         0         0         0    2.9946

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) 2017 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/.