フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

how to write a matrix to spesific excel row?

1 回表示 (過去 30 日間)
Ararat Cetinkaya
Ararat Cetinkaya 2020 年 2 月 8 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi everybody,
I have an 91x1 matrix and ı want to add this matric to excels F (Columns A to E are already full )column. I try to use xlswrite('testset.xls',classval','F1'); code but it deleted the other columns and writes the matrix on A column

回答 (1 件)

Giuseppe Inghilterra
Giuseppe Inghilterra 2020 年 2 月 8 日
Hi,
when you use xlswrite function, if you don't specify "sheet" as input argument, you must write the range in rectangular shape. In your case:
xlswrite(filename,matrix,'F1:F91');
If you want to deepen how to use xlswrite function, you can see: https://it.mathworks.com/help/matlab/ref/xlswrite.html
  2 件のコメント
Ararat Cetinkaya
Ararat Cetinkaya 2020 年 2 月 9 日
if my matrixs lenght is uncertain and its change depend on a loop, can ı wirte this in a loop with just giving a start point ?
Giuseppe Inghilterra
Giuseppe Inghilterra 2020 年 2 月 10 日
If you don't specify sheet name, you must define xlsrange in rectangular shape. If you write only the starting point as 'F1:F1', only the first matrix entry is written. Instead if you write the column 'F:F', the column F is filled with matrix values and then other values are filled with N/A values.
You can overcome this problem by specifying sheet name:
xlswrite('testset.xlsx',classval','sheetname','F1');
In this way you can indicate only the starting point without taking care of matrix dimension.

この質問は閉じられています。

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by