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 日

2 投票

a = [1,5,2,3,4,7,10,9]
[value,index]=max(a)
a(index)=[]

4 件のコメント

Vincent Sin
Vincent Sin 2018 年 12 月 1 日
Thank you very much that was really fast, u are a life saver !!!!!
madhan ravi
madhan ravi 2018 年 12 月 1 日
Anytime :) , you can also vote for the answer if you would like.
Vincent Sin
Vincent Sin 2018 年 12 月 1 日
already did thank you again!!!!!!
madhan ravi
madhan ravi 2018 年 12 月 1 日
Thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Get Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by