Put specific name in file via writematrix

26 ビュー (過去 30 日間)
Ivan Mich
Ivan Mich 2021 年 2 月 27 日
編集済み: the cyclist 2021 年 2 月 27 日
I want to create an output file. I would like my file to contains also one specific string (character) in its name.
My code is:
%A is a matrix (100x1 double)
str='2020'
writematrix(A,'output' str '.xlsx')
But command writematrix shows me error.
Could you please help me?

採用された回答

the cyclist
the cyclist 2021 年 2 月 27 日
編集済み: the cyclist 2021 年 2 月 27 日
You need to concatenate the character arrays. Here is one way to do that:
str='2020'
writematrix(A,['output',str,'.xlsx'])
  1 件のコメント
Walter Roberson
Walter Roberson 2021 年 2 月 27 日
Alternative:
writematrix(A,"output"+str+".xlsx")

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by