eigenvalues and eigenvectors question
조회 수: 4 (최근 30일)
이전 댓글 표시
Write a MATLAB routine that solves the problem:
(d/dt)u=Au; u(0)=u0 dt given a matrix A and initial condition u0, and plots the solution from t = 0 to t = 1.
This is what my instructor said
"you need to have a nested loop. First, establish a row vector *t* that runs from 0 to 1 in small increments (0.01 should work fine). Then, use the 'zeros' command to establish a matrix *u* that has the appropriate number of rows and a number of columns equal to the size of *t*. Then the outer loop iterates over the rows of *u*, and the inner loop iterates over the terms in the summation that I wrote on the board today(u0=sum c_i*x_i=Sc). Use a construct like this:
u(j,:) = u(j,:) + . . . ;
where *j* is the outer loop."
Here is what I have gotten to
function eigenplot(A,u0)
%v is eigen vectors x is eigenvalues
[v,x]=eig(A);
for t=(0:0.01:1)
obviously i need some help.
Thanks!
댓글 수: 0
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!