Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Conditional split into columns
3 ビュー (過去 30 日間)
古いコメントを表示
Hi all, I have got this array A=[10 20 30 40 50 10 20 30 40 10 30 30 40 .. .. Val]
My goal is to create a new column once an element of value 10 occurs in the array. Then I want to make a maximum of each particular column.
10 10 10
20 20 ..
30 30 ..
40 40
50
[50] [40] [..]
I tried some built in function within a loop (like sum, reshape, splitarray etc.) but there has always been an error which I did not understand quite much. Would anybody give me a hint, please?
Thank you.
1 件のコメント
Stephen23
2017 年 10 月 30 日
All elements of an array/matrix must contain a value. What value do you put into the second row third column position?
回答 (2 件)
Rik
2017 年 10 月 30 日
You might be able to bodge this together with a conversion to char, use strsplit (or even textscan), and use cellfun to convert back to double and find the max.
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!