Add 3 to the values of x that are even

 Akzeptierte Antwort

Friedrich
Friedrich am 11 Okt. 2011

1 Stimme

Hi,
x(find(mod(x,2) == 0)) = x(find(mod(x,2) == 0)) + 3
or
ind = find(mod(x,2) == 0);
x(ind) = x(ind) + 3;

Weitere Antworten (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!

Translated by