フィルターのクリア

Problem with saving a Matlab file

8 ビュー (過去 30 日間)
Paola
Paola 2022 年 2 月 10 日
回答済み: Star Strider 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 Center および File ExchangeWhos についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by