0

I want to save four variables in an excel sheet for following MATLAB code. Need your help on the last part of the code to achieve the same. Thank you in advance.

clear all;
close all;
for k = 1:9
filename = sprintf('Data_F_Ind000%d.txt',k);
data = load (filename);
alldata = eemd(data(:,1),0.01,10);
I1 = alldata (1,:);
I2 = alldata (2,:);
I3 = alldata (3,:);
I4 = alldata (4,:);
end
xlswrite('imf.xlsx',I1,1);
xlswrite('imf.xlsx',I2,2);
xlswrite('imf.xlsx',I3,3);
xlswrite('imf.xlsx',I4,4);

1 Answer 1

1

You need to use the function correctly

  xlswrite(<name of excel>, <matrix to save>, <sheet>, <range>)

for example:

%This writes your I1 matrix in the "yourExcelSheet" sheet into the
% "yourname.xlsx" file starting at the cell A1 and using all the space that
% matrix I1 needs to write
xlswrite ('yourname.xlsx',I1,'YourExcelSheet','A1');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.