Could not save my variable in a specific name

조회 수: 1 (최근 30일)
Seereen
Seereen 2019년 5월 11일
댓글: Seereen 2019년 5월 11일
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

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2019년 5월 11일
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
Seereen
Seereen 2019년 5월 11일
Ok I figure out my problem ... Thank you :)

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

추가 답변 (0개)

카테고리

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