採用された回答

Jan
Jan 2022 年 12 月 29 日
編集済み: Jan 2022 年 12 月 29 日

0 投票

With the bold guess, that you mean rand(100, 1) instead of rand(1:100):
data = rand(100, 1);
result = max(reshape(data, 10, 10))
% or explicitly:
result = max(reshape(data, 10, 10), [], 1)

3 件のコメント

abdullah al-dulaimi
abdullah al-dulaimi 2022 年 12 月 29 日
brother if i want max-1, i mean the result will be 9 19 29 39 49 59 69 79 89 99, how will be the code?
Walter Roberson
Walter Roberson 2022 年 12 月 29 日
are you looking for maximum value minus 1? If so subtract 1 from result
Or are you looking for the indices where the maximums appear? Or for the indices where the second highest appear?
Jan
Jan 2022 年 12 月 29 日
@abdullah al-dulaimi: "the result will be 9 19 29 39 49 59 69 79 89 99"?
Do you mean:
x = 9:10:100

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品

タグ

質問済み:

2022 年 12 月 29 日

コメント済み:

Jan
2022 年 12 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by