How to convert all vector elemens into zeros but not the maximum and the minimum of it?

1 回表示 (過去 30 日間)
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]);

採用された回答

darova
darova 2020 年 5 月 20 日
Try this modification

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by