How to select one of the array and change the array data selected with another value ?
Mostra commenti meno recenti
example :
datasample [83 84 82 81 82 86 81 85 87 *88*];
if datasample > 87
datasample = mean(datasample);
end
I want change the biggest value in datasample that is 88 with mean ( 83)
how to code like that ?
Risposta accettata
Più risposte (2)
[~,idx]=max(datasample);
datasample(idx)=mean(datasample)
Muhammad Hafiz
il 19 Mar 2018
0 voti
Categorie
Scopri di più su Matrix Indexing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!