define matrix with variable to iterate over
Show older comments
Hello, Its my first day at Matlab and I want to do the following:
I have a 9x9 matrix M(w) that has a variable w. I want to plot the 9 eigenvalues of M(w) (lets call them a_i with i=1,2,...,9) with respect to w. So in the end the graph is showing nine functions a_i(w) i=1,2,...,9.
My Code so far is:
w=(0:0.01:4)*ev/hb;
D_=zeros(9,length(w));
for n=1:length(w)
M=(Here define matrix);
[v,D]=eig(M);
D_(:,n)=diag(D);
end
Plot(hb*w/ev,D_)
Put I dont know how to define M properly such that with each iteration comes a new value for w. I hope someone can help me
Accepted Answer
More Answers (0)
Categories
Find more on Line Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!