check of a for loop
Afficher commentaires plus anciens
Hi guys, I would like to be sure that this for loop is correct.
B(:,:)=1./((m-1)*(mu0*tc-Wsim(:,:))).^(1/(m-1));
dB=B(2:end,:)-B(1:end-1,:);
for n=1:N
for t=1:steps-1
if abs(mu(t,n)./k)>uninum2;
B(t,n)=B(t,n).*(1-k);
%elseif abs(mu(t,:))*(1/k)>1;
% B(t,:)=B(t,:).*(1-k);
else
B(t,n)=1./((m-1)*(mu0*tc-Wsim(t,n))).^(1/(m-1));
B(t,n)=real(B(t,n))+imag(B(t,n));
end
B(t+1,n)=B(t,n)+dB(t,n);
end
end
When the loop restart, the B(t,n) that considers is the output of B(t+1,n) right? If not How can I build a loop that does something like that? thanks in advance
Gaia
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!