![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/295553/image.png)
How to convert all vector elemens into zeros but not the maximum and the minimum of it?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hamzah Faraj
am 20 Mai 2020
Beantwortet: darova
am 20 Mai 2020
Hey
How to turn v into zeros and just keep the maximum and the minimum alement?
% Generate v
n=[1,5];
v=unifrnd(-1, 5, n);
% Remove Direct Dublications
v = v([true, diff(v)~=0]);
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
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!