Get maximum value for a row in a MATLAB table

13 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by