Josh <jcyork01@louisville.edu> wrote in message
<18956547.1196639536763.JavaMail.jakarta@nitrogen.mathforum.org>...
> Definitions.m
>
[quoted text clipped - 25 lines]
> % Mv[1,10]
> Mv = [Mc 0 0 0 0 0 0 0 0 0; 0 Jc 0 0 0 0 0 0 0 0; 0 0 Mb 0 0 0 0 0 0 0; 0 0 0 Jb 0 0 0 0 0 0; 0 0 0 0 Mb 0 0 0 0 0; 0 0 0 0 0 Jb 0 0 0 0; 0 0 0 0 0 0 Mw 0 0 0;
0 0 0 0 0 0 0 Mw 0 0; 0 0 0 0 0 0 0 0 Mw 0; 0 0 0 0 0 0 0 0 0 Mw];
> Kv = [(2*K2) 0 -K2 0 -K2 0 0 0 0 0; 0 (2*K2*Lb^2) (-K2*Lb) 0 (K2*Lb) 0 0 0 0 0; -K2 (-K2*Lb) (K2+2*K1) 0 0 0 -K1 -K1 0 0; 0 0 0 (2*K1*Lw^2) 0 0 (-
K1*Lw) (K1*Lw) 0 0; -K2 (K2*Lb) 0 0 (K2+2*K1) 0 0 0 -K1 -K1; 0 0 0 0 0
(2*K1*Lw^2) 0 0 (-K1*Lw) (K1*Lw); 0 0 -K1 (-K1*Lw) 0 0 K1 0 0 0; 0 0 -K1
(K1*Lw) 0 0 0 K1 0 0; 0 0 0 0 -K1 (-K1*Lw) 0 0 K1 0; 0 0 0 0 -K1 (K1*Lw) 0 0
0 K1];
> % To get Eigen values and vectors: [K, M]=eig(Kv, Mv)
> % Note: Eigenvalue is M, Eigenvector is M
[quoted text clipped - 5 lines]
> % Eliminate Zeroes
> sparse(fn)
Um, sparse does not actually eliminate any zeros.
This is not its purpose, nor does it really have
that effect, even if unintentional.
So what is your purpose here? My guess is that
you wish to extract only the diagonal elements
of the diagonal matrix that eig returns. Use
diag for this purpose.
John
Josh - 03 Dec 2007 01:21 GMT
Great! I used the diag function and it worked great. Thanks for that. Still in need of more help!
John D'Errico - 03 Dec 2007 11:26 GMT
Josh <jcyork01@louisville.edu> wrote in message
<21914604.1196644917957.JavaMail.jakarta@nitrogen.mathforum.org>...
> Great! I used the diag function and it worked great. Thanks for that. Still in need of more help!
Ok. So you need more help. On what? Give us
a hint, since at least my own crystal ball is
always hazy. What did you try? What is wrong?
John
check a book by Ogota and the matlab help files for tutorials. they helped me.