If statement with an greater than comparison
116 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
James
am 6 Okt. 2014
Kommentiert: José-Luis
am 6 Okt. 2014
Hi,
I am trying to write an "if" statement between 2 values. I have a value "A" and a value "B". I want to set C to the value of A or B that is larger.
So like if A>B then C=A, otherwise C=B.
I am having trouble getting the proper code for this in matlab though.
Thanks
0 Kommentare
Akzeptierte Antwort
Guillaume
am 6 Okt. 2014
It's pretty much what you've written:
if A > B
C = A;
else
C = B;
end
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!