Put specific name in file via writematrix

17 vues (au cours des 30 derniers jours)
Ivan Mich
Ivan Mich le 27 Fév 2021
Modifié(e) : the cyclist le 27 Fév 2021
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?

Réponse acceptée

the cyclist
the cyclist le 27 Fév 2021
Modifié(e) : the cyclist le 27 Fév 2021
You need to concatenate the character arrays. Here is one way to do that:
str='2020'
writematrix(A,['output',str,'.xlsx'])
  1 commentaire
Walter Roberson
Walter Roberson le 27 Fév 2021
Alternative:
writematrix(A,"output"+str+".xlsx")

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur File Operations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by