How can I find the Difference between the Min and Max of all matching cells over different matrices?
19 ビュー (過去 30 日間)
古いコメントを表示
Basically I have 12 matrices each for a month of the year (33x45). For each cell I want to know the difference between the max and min values recorded for the entire year.
I then want an output that is another matrix with the resulting differences in the appropriate cells.
Thanks in advance for any assistance :)
1 件のコメント
Image Analyst
2014 年 10 月 8 日
Cells? Is the array a cell array or just a regular double numerical array? It's an important distinction regarding how you need to reference the cells or elements.
採用された回答
Mohammad Abouali
2014 年 10 月 8 日
編集済み: Mohammad Abouali
2014 年 10 月 8 日
so do this
Data(:,:,1)=Month1_Data;
Data(:,:,2)=Month2_Data;
.
.
.
Data(:,:,12)=Month12_Data;
then
Amplitude=max(Data,[],3)-min(Data,[],3);
Amplitude would be what you are asking.
1 件のコメント
その他の回答 (1 件)
Aslak Grinsted
2014 年 10 月 1 日
I would put the 12 matrices in a 33x45x12 matrix.
Then you can simply call
max(x,3)-min(x,3)
the '3' refers to take the maximum along the 3rd dimension of x.
参考
カテゴリ
Help Center および File Exchange で Shifting and Sorting Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!