Save variable to .mat file

조회 수: 2 (최근 30일)
Jan Kubicek
Jan Kubicek 2021년 4월 6일
댓글: Jan Kubicek 2021년 4월 13일
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.

답변 (1개)

David Fletcher
David Fletcher 2021년 4월 6일
편집: David Fletcher 2021년 4월 6일
try this:
save(strcat(Name,'_waviness'),'waviness')
  댓글 수: 1
Jan Kubicek
Jan Kubicek 2021년 4월 13일
It works well, thank you very much for your help :-)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by