Borrar filtros
Borrar filtros

Could not save my variable in a specific name

1 visualización (últimos 30 días)
Seereen
Seereen el 11 de Mayo de 2019
Comentada: Seereen el 11 de Mayo de 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

Respuesta aceptada

Sulaymon Eshkabilov
Sulaymon Eshkabilov el 11 de Mayo de 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

Más respuestas (0)

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by