Saving work space with a name from a variable

I want to save all the variables of the work space, with the name from variable.
I've tried using
filename = test.value;
save (filename)

 Respuesta aceptada

Image Analyst
Image Analyst el 18 de Oct. de 2016
Try this:
filename = sprintf('%s.mat', test.value); % where test.value is a string variable.
save(filename);

Más respuestas (1)

Walter Roberson
Walter Roberson el 18 de Oct. de 2016
save(filename)

1 comentario

RANJITH REDDY KALLURI
RANJITH REDDY KALLURI el 18 de Oct. de 2016
Editada: RANJITH REDDY KALLURI el 18 de Oct. de 2016
@Walter Roberson tried that, command works with no error. But .mat file is not created

Iniciar sesión para comentar.

Categorías

Community Treasure Hunt

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

Start Hunting!

Translated by