How do I resize an irregular matrix?

Sorry, I am relatively new at matlab and I can't seem to figure out an answer online. Say for example, I have a vector A = (3,1,4,1,3,6,9,3,1,3), how do I make a vector B from vector A so that it takes the maximum value of vector A to the end of vector A so that vector B is (9,3,1,3)?

回答 (1 件)

Image Analyst
Image Analyst 2017 年 10 月 19 日

0 投票

Try this:
A = [3,1,4,1,3,6,9,3,1,3]
[~, indexOfMax] = max(A);
B = A(indexOfMax:end)

カテゴリ

ヘルプ センター および File ExchangeResizing and Reshaping Matrices についてさらに検索

質問済み:

2017 年 10 月 19 日

回答済み:

2017 年 10 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by