check of a for loop
이전 댓글 표시
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
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!