Hi
I've been trying to export results data into multiple excel file.
I've 35 variable which are perturbed individually to see their impact ont eh remaing one. For each perturbation the code is making an excel file, which gives me 35 files. Is tehre anyway I can export the data of each perturbation effect on 35 sheets ratehr than 35 files. Follwoing is the code I'm using.
sheet=1;
xlRange='A2';
xlswrite(filename,Results_Values,sheet,xlRange);
sheet=1;
xlRange='A1';
xlswrite(filename,Results_Names,sheet,xlRange);
clear xlRange sheet xlRange sheet Results_Values Results_Names filename str values2 values
winopen('Output.xls');
Thanks.

 採用された回答

Mathieu NOE
Mathieu NOE 2021 年 2 月 2 日

0 投票

hello
see example below :
for k=1:10
xlswrite('Result.xlsx',rand(k),k);
writematrix(rand(k),'myData.xlsx','Sheet',k);
end

3 件のコメント

Mustafa Pasha
Mustafa Pasha 2021 年 2 月 2 日
Could you please explain that?
I'm not hundred percent sure, how should I relate this to my code? Are you not making 2 excel files? 1- reslts and 2- mydata?
Mathieu NOE
Mathieu NOE 2021 年 2 月 3 日
hllo
this is an example using either xlswrite or writematrix to store data in separates sheets in one single excel file
xlswrite is older , so use writematrix if you have a recent release
Mustafa Pasha
Mustafa Pasha 2021 年 2 月 4 日
Thanks a ton

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by