Save variable to .mat file

I would like to kindly ask you for the help with dynamical naming of saved variables in MATLAB.
I have the variable:
Name=’image_xx’
My script generates a variable: waviness
My problem is that I need to save the variable waviness to the .mat file with the name:
image_xx_waviness via the command save(). Please, can you help me how to do that.
Many thanks for any help.

Respuestas (1)

David Fletcher
David Fletcher el 6 de Abr. de 2021
Editada: David Fletcher el 6 de Abr. de 2021

0 votos

try this:
save(strcat(Name,'_waviness'),'waviness')

1 comentario

Jan Kubicek
Jan Kubicek el 13 de Abr. de 2021
It works well, thank you very much for your help :-)

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB Report Generator en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 6 de Abr. de 2021

Comentada:

el 13 de Abr. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by