replace p percent of largest values in matrix columns
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Razieh
am 16 Apr. 2015
Bearbeitet: Guillaume
am 16 Apr. 2015
Hi friends, I want to replace p percent of largest values of each individual column in A matrix (size m by n) with NaN. would you plz help me ,
0 Kommentare
Akzeptierte Antwort
Guillaume
am 16 Apr. 2015
Bearbeitet: Guillaume
am 16 Apr. 2015
By "I want to replace p percent of largest values", I assume you mean replace the value of A that are greater than (1-p) * max_value_of_A. If not, you'll have to clarify what you mean.
A = rand(8, 10) %for example
p = 0.1; %for example
maxvalue = max(A(:));
threshold = (1-p) * maxvalue;
A(A >= threshold) = NaN
0 Kommentare
Weitere Antworten (0)
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!