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!