Skip to main content
1-Visitor
April 6, 2011
Question

Eigenvectors and Eivenvalues

  • April 6, 2011
  • 4 replies
  • 3763 views

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

12-Amethyst
April 6, 2011

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

atbarajas1-VisitorAuthor
1-Visitor
April 7, 2011

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.

19-Tanzanite
April 6, 2011

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))

atbarajas1-VisitorAuthor
1-Visitor
April 7, 2011

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.