Cell arrays into excel

Hi!
I have a cell array like the following:
I want to put each matrix of row 2 in one spreed sheet named as text in row 1. Been trying but don't not know to do it.
Thanks

 Risposta accettata

Stephen23
Stephen23 il 7 Apr 2022
Where C is your cell array:
F = 'myfile.xlsx';
for k = 1:size(C,2)
T = C{1,k};
M = C{2,k};
writematrix(M, F, 'Sheet',T)
end

2 Commenti

Valeria AS
Valeria AS il 7 Apr 2022
Awesome!!
It works very well, thanks so much, Stephen!
Stephen23
Stephen23 il 7 Apr 2022
@Valeria AS: if it helped you, please remember to accept my answer :)

Accedi per commentare.

Più risposte (0)

Categorie

Community Treasure Hunt

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

Start Hunting!

Translated by