Add 3 to the values of x that are even
Ältere Kommentare anzeigen
x=[7 6 1 2 0 -1 4 3 -2 0]
how do I do this in smart short way?
Akzeptierte Antwort
Weitere Antworten (2)
Arash
am 11 Okt. 2011
0 Stimmen
Walter Roberson
am 11 Okt. 2011
x = x + 3 * ~mod(x,2);
Kategorien
Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!