replace array value with if condition
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello
hello, i have samply array,I would like to replace all numbers greater than 5 to be 5 and lower than 4 to be 2
in my experiment above its success if condition greater than 5. How about lower than 2 it is posible? , and the result i want A=[2 2 2 2 5 5 5 5 5]
A=[4 4 4 4 5 6 7 8 9 ]
max(A)
min(A)
if max(A)>=5
A(A>=5)=5
end
Thanks a lot
0 Kommentare
Antworten (1)
Siehe auch
Kategorien
Mehr zu NaNs 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!