How do I get data from each step in a loop?

2 vues (au cours des 30 derniers jours)
Andre
Andre le 18 Avr 2013
Hello.
I want my array resu to save all date for each n=1,2,3... in row n, and start the same procedure for next n. So in the first row in resu i want to have an array when n=1 while looping m and j. Second row scould be an array when n=2 while looping m and j. And so on, all the way until n=N.
Any suggestions what iam doing wrong?
My code:
resu = zeros([N,length(t)]);
u=zeros(size(t));
for n=1:N
for m=1:N
for j=1:Q
Omega=omegaakse(j);
u=u+abs(Gu(n,m,j))*sqrt(2*domega)*cos(Omega.*t+2*pi*rand);
end
end
resu(n,:) = u;
end
where t i a time vector.

Réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements 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