doubt in for Loop
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
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.
Antworten (1)
Walter Roberson
am 8 Okt. 2020
for K = 1 : numel(e)
if all(e(K) + t < L)
.......(some logic)
end
end
4 Kommentare
Anurag Gupta
am 9 Okt. 2020
Walter Roberson
am 9 Okt. 2020
for K = 1 : numel(t)
if all(e + t(K) < L)
.......(some logic)
end
end
Anurag Gupta
am 9 Okt. 2020
Walter Roberson
am 9 Okt. 2020
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.
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!