cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Eigenvectors and Eivenvalues

Highlighted
Newbie

Eigenvectors and Eivenvalues

Hello,

I'm writing a program and in it I need to calculate the eigenvectors and eigenvalues so that I can determine my mode shapes, but I cannot seem to get the script to cooperate with me. I've determined the eigenvalues, but when I try to get the eigenvectors by using a loop, I get the error message that my eigenvalue (l) isn't a scalar. I think the error lies in formatting somewhere, but I can't seem to find it. If someone could please take a look at the script I've attached it would be greatly appreciated. Also, is there a way that I can assign my eigenvalues and sort them at the same time so that I can skip the step with l1?

Thank you

4 REPLIES 4

Re: Eigenvectors and Eivenvalues

Looks like a but, same loop works inside a program.
See file for some suggestions.

Re: Eigenvectors and Eivenvalues

It doesn't like having the assignment and evaluation in the same expression. Split off the evaluation of X.

Also, is there a way that I can assign my eigenvalues and sort them at the same time so that I can skip the step with l1?

Just do sort(eigenvals(D))

Re: Eigenvectors and Eivenvalues

I tried to do the sort(eigenvals(D)) twice, and it worked the first time but not the same time even though I had the exact same procedure. I guess it's just picky. Thank you for your help.

Re: Eigenvectors and Eivenvalues

Thank you so much. I was hoping that what I had written down would work, but I guess I'll have to let go and just go the loop route. Thanks again, I appreciate it.