How to create a bidimensional matrix containing the maximum values from a tridimensional one?

4 ビュー (過去 30 日間)
Hi Matlab users,
I have a 3D matrix that goes like this: G(57,121,6672) where 57 is the longitude, 121 the latitude and 6672 is time. What I want to do (and I have no idea how) is to create a new matrix that will contain a maximum or median value for every point. How do I do it?
Please help.
Robert.

採用された回答

José-Luis
José-Luis 2012 年 9 月 18 日
編集済み: José-Luis 2012 年 9 月 18 日
your_median = median(G,3);
your_max = max(G,3);
Such functions allow you to accumulate along a specified dimension (the second argument says which)
  2 件のコメント
Robert
Robert 2012 年 9 月 18 日
Thank you, but this results in a 3D matrix of 57x121x6672 just like the original one, so I'm not sure that it really computes the maximum/median. How I see it is that I should obtain a bidimensional matrix of 57x121 elements with the max or median.
Robert
Robert 2012 年 9 月 18 日
Found it: in order to obtain the 2D matrix the syntax was: Gmax=max(G,[],3);

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by