Get maximum value for a row in a MATLAB table

30 ビュー (過去 30 日間)
Robert Demyanovich
Robert Demyanovich 2022 年 3 月 9 日
回答済み: Voss 2022 年 3 月 9 日
I need to get the maximum value for a specific row in a MATLAB table (not matrix). Let the variable i specify the row number in the table,

回答 (1 件)

Voss
Voss 2022 年 3 月 9 日
t = table(randn(10,1),randn(10,1))
t = 10×2 table
Var1 Var2 ________ ________ -1.0096 -0.17839 0.11734 0.91067 1.6059 -1.3539 0.77477 -1.7898 0.64388 0.60792 -0.74874 -2.3333 0.70785 -1.286 -1.2768 -0.57887 0.55059 0.24306 -0.45904 1.4979
i = 5;
% maximum value of row i in table t:
max(t{i,:})
ans = 0.6439

カテゴリ

Help Center および File ExchangeTables についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by