matrix if statement is above .5 then can I re enter it to show .5
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
cormac spillane
am 27 Apr. 2015
Beantwortet: Thorsten
am 27 Apr. 2015
I have a large matrix(x) and I want to change any value the is above .5 or below -.5 to .5 or -.5 respectively in a certain column(2). any assistance regarding this topic would be greatly appreciated.
regards, cormac
0 Kommentare
Akzeptierte Antwort
Guillaume
am 27 Apr. 2015
A = rand(10, 10)*2-1; %create matrix between -1 to 1, for demo
A(A < -0.5) = -0.5;
A(A > 0.5) = 0.5
0 Kommentare
Weitere Antworten (1)
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!