Max Value of Certain Row in Cell Array?
1 回表示 (過去 30 日間)
古いコメントを表示
I have a 15x15 array and I would like the max value from the 4th row, how would I go about doing this?
2 件のコメント
Image Analyst
2015 年 12 月 3 日
Is the 15x15 array in each cell? Or is the cell array itself 15 by 15 and something else is inside each cell, like a scalar? Have you read this: http://matlab.wikia.com/wiki/FAQ#What_is_a_cell_array.3F
Have you seen cellfun()?
採用された回答
Andrei Bobrov
2015 年 12 月 3 日
a = cell2mat(yourcellarray);
out = max(a(4,:));
3 件のコメント
Stephen23
2015 年 12 月 3 日
@Ibro Tutic: really there is no reason to store lots of scalar numeric values in a cell array, when a simple numeric array would make your code much simpler. You can see that the very first step of Andrei Bobrov's Answer is to convert the data to a numeric array, and see how easy the solution is using this numeric array.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!