eigenvalues and eigenvectors question

4 vues (au cours des 30 derniers jours)
Kyle
Kyle le 7 Fév 2013
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!

Réponses (0)

Catégories

En savoir plus sur Linear Algebra dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by