How to properly augment a cell vector to a matrix doubles and output on excel?

1 回表示 (過去 30 日間)
Karl
Karl 2022 年 12 月 7 日
編集済み: Karl 2022 年 12 月 7 日
Hello all, say you have a 1x4 cell that you would like to augment to a 4x4 matrix consisting of numbers. I could use some helping figuring out what I am doing wrong and perhaps a way that is more efficient to what I am doing.
nexample = [150, 176, 20, 2000
200, 181, 18, 2300 ]
150, 168, 17, 1900
190, 182, 30, 2400]
nlabels = [{'Weight (lbs) ','Height (cm)','Age','Calorie Consumption'}];
nlabels1 = str2double(nlabels);
nexcel = [nlabels1;nexample];
xlswrite('Examplesheet',nexcel)
I would like those labels to stack ontop of the matrix when it shows on the excel sheet. I would appreicate any help on doing this.
I have an additional question aswell(low priority): How can I write the script to bold the texts for nlabels when it shows on excel?

採用された回答

Jiri Hajek
Jiri Hajek 2022 年 12 月 7 日
編集済み: Jiri Hajek 2022 年 12 月 7 日
Hi, you need to get acquainted with tables. They enable you to do exactly what you need.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by