Hi everyone,
I want to obtain two matrix with same dimension starting from two matrix with different dimension. In the two matrix I have match between the data by year, month, day and hour. The matrixes in output should have the same match between the data of the matrixes of starting. I'm attacching the code below and the compressed folder that contains the xlsx files. Thanks.
format long gfolderData = 'D:\Valerio\data\ACCESS1.0';filePattern = fullfile(folderData, '*.xlsx');xlsFiles = dir(filePattern);nFiles = length(xlsFiles);for ii = 1:nFiles filename = fullfile(xlsFiles(ii).folder, xlsFiles(ii).name); files{ii} = xlsread(filename);endIPCC = files(1);ERA5 = files(2);Data_IPCC = IPCC{:,1};ERA5_data = ERA5{:,1};IPCC_data = unique(Data_IPCC,'rows');Years_IPCC = IPCC_data(:,1);Years_ERA5 = ERA5_data(:,1);range_IPCC = length(IPCC_data);range_ERA5 = length(ERA5_data);k = 1;for i = 1:range_ERA5; for j = 1:range_IPCC; if Years_ERA5 == Years_IPCC; A(k,:) = ERA5_data(i,:); end end k = k + 1end
With this code I obtaine this error:
C_Fourier_AnalysisMatrix dimensions must agree.Error in C_Fourier_Analysis (line 27) if Years_ERA5 == Years_IPCC;
Best Answer