Info
この質問は閉じられています。 編集または回答するには再度開いてください。
doubt in for Loop
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
Now i want to execute a formula;
if e+t<L
.......(some logic)
wherein the size of e= 8x1 doubt
t=28x1 doubt
L=8x1 doubt.
Is there anyway I can execute this line.
Please help.
0 件のコメント
回答 (1 件)
Walter Roberson
2020 年 10 月 8 日
for K = 1 : numel(e)
if all(e(K) + t < L)
.......(some logic)
end
end
4 件のコメント
Walter Roberson
2020 年 10 月 9 日
The code I posted,
for K = 1 : numel(t)
if all(e + t(K) < L)
.......(some logic)
end
end
does not index e, so you will not get an error about the number of elements in e.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!