Could not save my variable in a specific name
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File 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!