How to make a vector shorter ?

조회 수: 3 (최근 30일)
Vincent Sin
Vincent Sin 2018년 12월 1일
댓글: madhan ravi 2018년 12월 1일
Hey everyone i have a simple problem but i cant find a proper solution.
let's say i have a vector of numbers a = [1,5,2,3,4,7,10,9]
what i want to do is: i want to find the maximum of the values in the vector (i know how to do that) but then i want to delete the maximum value from the vector to make it shorter
can someone tell me how to do it ?

채택된 답변

madhan ravi
madhan ravi 2018년 12월 1일
a = [1,5,2,3,4,7,10,9]
[value,index]=max(a)
a(index)=[]
  댓글 수: 4
Vincent Sin
Vincent Sin 2018년 12월 1일
already did thank you again!!!!!!
madhan ravi
madhan ravi 2018년 12월 1일
Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by