Find minimum value in matrix and test for symmetry
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
David du Preez
am 8 Mär. 2017
Kommentiert: David du Preez
am 13 Mär. 2017
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 Kommentare
kowshik Thopalli
am 8 Mär. 2017
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)
Akzeptierte Antwort
Jan
am 8 Mär. 2017
Bearbeitet: Jan
am 8 Mär. 2017
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Dates and Time finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!