Effacer les filtres
Effacer les filtres

Could not save my variable in a specific name

1 vue (au cours des 30 derniers jours)
Seereen
Seereen le 11 Mai 2019
Commenté : Seereen le 11 Mai 2019
I am trying to save Z in a spceific file name ... I am geting error saya
Error using save
Must be a string scalar or character vector.
Here is my code ... any idea ?
filename=['synthetic_data.' num2str(1) '.mat'];
save (filename, Z);
Thank you

Réponse acceptée

Sulaymon Eshkabilov
Sulaymon Eshkabilov le 11 Mai 2019
Two very tiny flaws (e.g.: unnecessary "." and necessary ' ') in your used syntax and here is the correct syntax:
filename=['synthetic_data' num2str(1) '.mat'];
save (filename, 'Z'); % Z is already residing in your workspace
  1 commentaire
Seereen
Seereen le 11 Mai 2019
Ok I figure out my problem ... Thank you :)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by