Get maximum value for a row in a MATLAB table

11 views (last 30 days)
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,

Answers (1)

Voss
Voss on 9 Mar 2022
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

Community Treasure Hunt

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

Start Hunting!