Error while using xlswrite for arrays
Show older comments
I am trying to write few arrays of equal size 1x234 into excel but getting the following error. "Dimensions of matrices being concatenated are not consistent." My code is as follows:
Mean_percentage=[{'RandomVariable','Meanof_VA_iter','Mean_of_C_iter','Mean_of_P_iter','Mean_of_I_iter','Mean_of_U_iter'};Random,MeanVA,MeanC,MeanP,MeanI,MeanU]
xlswrite('Means', Mean_percentage)
All the arrays Random, MeanVA,MeanC,MeanP,MeanI,MeanU are of size 1x234 cell. How to fix this?
Accepted Answer
More Answers (1)
Guillaume
on 11 Nov 2016
Even simpler,
t = table(Random, MeanVA, MeanC, MeanP, MeanI, MeanU , 'VariableNames', ...
{'RandomVariable', 'Meanof_VA_iter', 'Mean_of_C_iter', 'Mean_of_P_iter', 'Mean_of_I_iter', 'Mean_of_U_iter'});
writetable(t, 'Means.xlsx');
1 Comment
Daniyal Ali
on 11 Nov 2016
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!