Azzera filtri
Azzera filtri

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

2 visualizzazioni (ultimi 30 giorni)
Andre
Andre il 18 Apr 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.

Risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by