I have 100 column xlsx file with size (4097,100). I need to read first column and do some processing and this results in four row variables (1,4097 each) for the first column data only. Further, I need to process each of these four row variables to obtain its statistical parameters such as min, max, mean, SD, var in MATLAB. How to do it with nested for loop? I appreciate your help. The sample MATLAB code that I am trying is where I have considered only two columns A1 and A2:
A = xlsread('S.xlsx');
num_rows = size(A,1);
num_cols = size(A,2);
A1 = A (:,1);
A2 = A (:,2);
B = {A1,A2};
for i = 1:2
for j = 1:4
IMF = emd(B{i},'STOP',[0.1,0.5,0.05],'MAXITERATIONS',100);
I1 = IMF (1,:);
I2 = IMF (2,:);
I3 = IMF (3,:);
I4 = IMF (4,:);
imf = {I1, I2, I3, I4};
m1(j) = mean(imf{j});
m2(j) = min(imf{j});
m3(j) = max(imf{j});
m4(j) = std(imf{j});
m5(j) = var(imf{j});
end
end
Another variation in the code I tried is:
A = xlsread('S.xlsx');
num_rows = size(A,1);
num_cols = size(A,2);
A1 = A (:,1);
A2 = A (:,2);
B = {A1,A2};
for i = 1:2
IMF = emd(B{i},'STOP',[0.1,0.5,0.05],'MAXITERATIONS',100);
I1 = IMF (1,:);
I2 = IMF (2,:);
I3 = IMF (3,:);
I4 = IMF (4,:);
imf = {I1, I2, I3, I4};
for j = 1:4
m1(j) = mean(imf{j});
m2(j) = min(imf{j});
m3(j) = max(imf{j});
m4(j) = std(imf{j});
m5(j) = var(imf{j});
end
end
But no success. I am getting the stats values only for the first column i.e. four values for I1, I2, I3 and I4. The second column A2 is not being processed.