Why do I get this result??
Ältere Kommentare anzeigen
Hello
I have a problem with this code
k=2*A+3*B
if k<3.65
fr='inf'
elseif 3.65<k<=4.35
fr='moy'
elseif k>4.35
fr='sup'
end
why i get this result 'moy'?? it must be 'sup'
k =
6.4582
fr =
moy
Can you help me to correct this code.
Akzeptierte Antwort
Weitere Antworten (2)
David Barry
am 7 Nov. 2012
Try this
k=2*A+3*B
if k<3.65
fr='inf'
elseif k >= 3.65 && k<= 4.35
fr='moy'
elseif k>4.35
fr='sup'
end
3 Kommentare
David Barry
am 7 Nov. 2012
Looks like Evan beat me to it. && is MATLAB command for logical AND.
David Barry
am 7 Nov. 2012
Also note that I have changed your code to cope when k = 3.65
Evan
am 7 Nov. 2012
Good catch. I didn't notice that. I've updated my post to account for that issue, but credit goes to you. :)
Sean de Wolski
am 7 Nov. 2012
0 Stimmen
Kategorien
Mehr zu Filter Analysis finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!