Export Matrix into Excel or Text

1 view (last 30 days)
Mayrin Mejia
Mayrin Mejia on 21 Mar 2021
Answered: Walter Roberson on 21 Mar 2021
I have a matrix I've been trying to export to either excel or txt. I converted it from syms to char first because I would get error if i left it as syms. The output matrix is super long and starts as cos((theta*pi)/180)^2*(cos((theta*pi)/180)^2/(E11*(2*cos((theta*pi)/180). When I trid exporting it to excel, it was all placed in one cell and its a 3 x 3 matrix. How do i export it so it's all separated
Sbar = char(GlobalReducedCompliance(E11, E22, nu12, G12, theta));
writematrix(Sbar,'sbar.xlsx')

Answers (1)

Walter Roberson
Walter Roberson on 21 Mar 2021
Sbar = cellfun(@char, GlobalReducedCompliance(E11, E22, nu12, G12, theta), 'uniform', 0);
writecell(Sbar, 'sbar.xlsx');

Tags

Community Treasure Hunt

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

Start Hunting!