how to bin data based on two variables to create a joint occurance table?
조회 수: 10 (최근 30일)
이전 댓글 표시
Hi everyone, I have only recently started to use MATLAB so please be patient, I'm sorry if I have trouble explaining myself properly.
I am trying to analyse the wave resource off the Isles of Scilly.
I have a huge structure array and I wish to sort the data into a table that shows how often conditions occur within bin ranges for two variables. i.e how often wave heights are between 3 - 3.5 meters whilst wave period is between 5 - 5.5 seconds. In this case the variables are called H and T.
H =[data(:,1).Hsig]<br>
T = [data(:,1).Tm_10]<br>
I have created one table so far using a simple for loop;
for i=0:0.5:10
m = [sum(H>=i & H<i+0.5 & T>=1.5 & T<2)]
end
However, obviously this only changes the height and I have manually changed the T values and run the program again whilst noting down the values each time. As you can see this is ridiculously crude and time consuming and I have 12 more tables to create, (one for each location).
Can anybody advise on how I can bin the data based on changing H and T values at the same time.
I realise I have explained this poorly, and I have attached a screen shot of the first table I have created to hopefully show what I am trying to do.

Any help will be immensely appreciated.
James
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Labels and Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!