Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

How can I solve this loop?

1 Ansicht (letzte 30 Tage)
maria
maria am 26 Nov. 2013
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I have the following:
R=[-0.1 0 0.1 0.2 0.3 0.4]
Length=20;
theta=(P_hight-Diam)/Length;
for i=1:1:5;
if R(i)>0 & R(i)>theta;
M(i)=1;
end
end
a1=sum(M);
When I make my Length bigger a1 also increase. I would like to make a loop which give me the minimum Length where a is the bigger.
Can some one help me?
  1 Kommentar
Wayne King
Wayne King am 26 Nov. 2013
Can you please clarify what you want. Increasing Length will reduce the value of theta and therefore I'm not surprised that M would have more nonzero entries and the sum would be larger.

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by