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 CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by