Find minimum value in matrix and test for symmetry

1 回表示 (過去 30 日間)
David du Preez
David du Preez 2017 年 3 月 8 日
コメント済み: David du Preez 2017 年 3 月 13 日
Hi. I have a 2160x6 matrix (attached). The columns represent: Year(1), month(2), day(3), hour(4), UVI(5),SZA(6).
The data is hourly and I need to find the minimum SZA value for every 24 (hours) for rows. Can I use something like this to find the minimum value?
a=CP_06_07DJF(1:24,6);
min1=min(a(:))
Then I need to test if the UVI values are symmetric about the point where the SZA is lowest and repeat this for everyday.
  2 件のコメント
kowshik Thopalli
kowshik Thopalli 2017 年 3 月 8 日
Looking at your data for the first few hours in every 24 hrs the value of SZA is zero. Could you tell us how would you define symmetry now?.
Yes the code that you have will give min value . using the below line will also give you the index at which the minimum value appears
[min1,index]= min(a)
David du Preez
David du Preez 2017 年 3 月 8 日
Once I have the minimum SZA (solar zenith angle)for each day. I need to determine if the UVI data is symmetric. The UVI data represents solar ultraviolet radiation. Therefore when the SZA and UVI the is no data.

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

採用された回答

Jan
Jan 2017 年 3 月 8 日
編集済み: Jan 2017 年 3 月 8 日
Date = datenum(CP_06_07DJF(1:3), 6); % Year, Month, Day
Value = CP_06_07DJF(:, 6);
G = findgroups(Date);
Min1 = splitapply(@min, Value, G);
Or if the data are dense (you get 24 values for each day and no additional hours:
Value = CP_06_07DJF(:, 6);
Min1 = min(reshape(Value, 24, []), [], 1);
This reshape the value to a [24 x N] matrix and finds the minimum along the first dimension.
The "symmetric" part is not clear to me. Can you post a small example?
  5 件のコメント
Jan
Jan 2017 年 3 月 13 日
編集済み: Jan 2017 年 3 月 13 日
Please give a short example. How do you define "symmetry" here? Please note that I'm still not sure what "UVI" and "SZA" is. Simply post some values, because the names and meanings do not matter for Matlab also. ;-)
David du Preez
David du Preez 2017 年 3 月 13 日
The graph produced by each 24 hour UVI should be symmetric by the as drawn in the attached images. Sym_1(2) is not symmetric and sym_2 is symmetric.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by