Problem with saving a Matlab file

5 次查看(过去 30 天)
Paola
Paola 2022-2-10
Hi Guys,
My code shoud generate a mat lab file in which I have all the variables. Unfortunatly, I am not able to generate it correclty: Instead of having a .mat file I have a blank file without "termination" (not .mat). Can you help me to understand the problem?
basename=1ug
save([basename '_BTads']) . This is the line I use to save it
thanks

回答(1 个)

Star Strider
Star Strider 2022-2-10
Always supply the .mat extension yourself. MATLAB has no way of knowing otherwise, and assumes that what you assume is a file name is a variable that MATLAB can’t find.
See if:
save([basename '_BTads.mat'])
will do what you want. (This will save every variable in the current workspace, not selected variables, so specify them if you only wnat to save some of them.)
.

类别

Help CenterFile Exchange 中查找有关 Debugging and Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by