Problems comparing data from two matrices of different sizes in Matlab

Asked

Viewed 205 times

1

I have a data matrix, with non-leap years, and in which matrix it was separated:

Data = [year month data];

Size = 14965 rows and 5 columns

And I have an array parameters, to compare with "data1" and "data2", with size 365 rows and 2 columns, where in column 1 I have the parameter X1 to compare with "data1" and in column 2 I have x2 to compare with "data2".

Parameters = [X1 x2]

The X1 parameter should be compared to "data1" daily, where I should analyze if "data1" > X1. The same should be done for "data2" in relation to x2.

I’m having trouble creating a method or a loop to make these daily comparisons and all the years of the matrix "Data".

Can someone help me?

1 answer

0

It was not very clear his doubt. However... from what I could imagine...

Data has 14965 lines for 41 years of data, does it? data 1 and data2 with 365 lines for 1 year of data, check?

ano_analise = 1; 
id_dado_ano = (ano_analise-1)*(1:100);
comparacao_diaria = Dados(id_dado_ano,[4 5])>[x1 x2];
percentagem_anual = sum(comparacao_diaria)./size(comparacao_diaria,1)

makes sense?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.