copying values using if statements
Ältere Kommentare anzeigen
I am trying to write an if statement for a give matrix.
I have a matrix that is 54,1, with given values.
What I want it to do is that if the value is greater that 0, to make it equal to that value in the given matrix, and if the value is less than 0, to make it equal to 0.
Antworten (1)
Honglei Chen
am 4 Dez. 2012
Bearbeitet: Honglei Chen
am 4 Dez. 2012
say x is your matrix
x = randn(54,1);
x(x<0)= 0
Kategorien
Mehr zu Logical 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!