Exporting table to excel
Show older comments
Good Afternoon, I will try to keep this to the point. I have created two tables and they ready to be exported to excel. Say T1 is [1600x5] and t2 is [2x4]. How can I concatenate those two tables into one so then I will be able to use the "writetable" function? I have tried the "horzcat" and the "union" functions but I keep getting errors due to the dimensions not being the same. Is there a way around this?
Date = datetime('today'); M1 = table(Temp_K, Pressure, inverse_temp, N_Log, k_value_slope); (1600x5) Matrix M2 = table(MM, Date, Pan_Size, Experiment_Date); (2x4) matrix M = horzcat(M1, M2); M = table(Temp_K, Pressure, inverse_temp, N_Log, k_value_slope, MM, Pan_Size); name = input('Enter the name you wish to save the file as, use single quotes (ex. filename.xlsx) : '); writetable(M, name,'Sheet',1,'Range','B1');
3 Comments
Sourin Dey
on 27 Jun 2016
use blkdiag(A,b) .
Javier Joya
on 27 Jun 2016
Sourin Dey
on 27 Jun 2016
- x=[1 2 3 6 ;4 5 6 51 ;7 8 9 2 ;10 11 12 11];
- y=[4 5 6;7 8 9];
- C = blkdiag(x,y);
- C(1:2,5:7)=y;
- C(5:6,:)=[] . thus [4*4] & [2*3] can be concatenated , or any other dimensions as well.
Accepted Answer
More Answers (0)
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!