I am trying to write data on to Excel on a specific but dynamic location (say not E1 or C3 but depending on what I have done in the code, row no. 2*i and column 4*y). Is it possible to do that?
3 ビュー (過去 30 日間)
古いコメントを表示
I am trying to write data on to Excel on a specific but dynamic location (say not E1 or C3 but depending on what I have done in the code, row no. 2*i and column 4*y). Is it possible to do that?
0 件のコメント
回答 (1 件)
Caglar
2018 年 12 月 20 日
編集済み: Caglar
2018 年 12 月 20 日
You need to convert your row and column into cell name that xlswrite understands.
cellname=[xlscol(column) num2str(row)];
You need xlscol from fileexchange: https://www.mathworks.com/matlabcentral/fileexchange/28343-column-converter-for-excel?focused=5156839&tab=function
Note that xlswrite starts to write from that cell, but does not limit writing to that cell. If you feed it with an array or matrix, it will write on neigbour cells too.
An unexpected behaviour (at least to me) is that it writes one letter per cell when writing a char array or string. Therefore, use cellstr(yourtext) when writing those.
2 件のコメント
madhan ravi
2018 年 12 月 20 日
編集済み: madhan ravi
2018 年 12 月 20 日
@Caglar you can select the particular code and press the code button so that the reader is able to know where the code is easily, thanks for understanding.
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!