Writing data from Matlab to Excel Macro sheet

2 ビュー (過去 30 日間)
kaivlya patel
kaivlya patel 2020 年 4 月 25 日
コメント済み: kaivlya patel 2020 年 4 月 28 日
I want to export the data generated in Matlab, to be written into .xlsm file.
I have my Matlab file generated in C folder and my macro excel file is in D folder.
I wan to send this following data to the .xlsm file.
5×5 string array
"10" "HPP" "ELS" "HFS" "MINT"
"19" "HPP" "PC" "HFS" "MINT"
"21" "HPP" "PC" "HFS" "PR"
"" "" "" "" ""
"" "" "" "" ""
Any help would be really appreciated and I would be greatful.
  1 件のコメント
kaivlya patel
kaivlya patel 2020 年 4 月 25 日
the location of the excel file is : "D:\CVT\VBA\Practice of the tradspace updated file.xlsm" and I want to export the data from Matlab to this excel macro file

サインインしてコメントする。

採用された回答

Sai Sri Pathuri
Sai Sri Pathuri 2020 年 4 月 28 日
You may use writematrix function to write the string array to macro excel sheet by giving the full path of macro excel sheet as filename.
filename = 'D:\CVT\VBA\Practice of the tradspace updated file.xlsm';
writematrix(stringArray,filename);
  3 件のコメント
Sai Sri Pathuri
Sai Sri Pathuri 2020 年 4 月 28 日
If you want to write all the rows vertically, you may transpose the string array and write it
writematrix(stringArray',filename);
kaivlya patel
kaivlya patel 2020 年 4 月 28 日
I thaught so but was not sure but I checked it with some samll changes this works.
Thank you very much again for the help.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by