Not valid variable name despite variable declaration i MATLAB app designer.
显示 更早的评论
After the analysis of the images, I want to save the parameters in .mat file. The following code is for the same,
function SaveButtonPushed(app, event)
app.filename = strcat(app.filename,'.mat');
if isempty(app.FLG)
save(app.filename,'app.para_BF_new','app.ROI')
elseif isempty(app.FLR)
save(app.filename,'app.para_BF_new','app.para_FLG','app.ROI')
elseif isempty(app.FLFR)
save(app.filename,'app.para_BF_new','app.para_FLG','app.para_FLR','app.ROI')
else
save(app.filename,'app.para_BF_new','app.para_FLG','app.para_FLR','app.para_FLFR','app.ROI')
end
However, the following error is coming in MATLAB app designer but is working fine as simple Matlab code. I have already declared all the variables properly.
Error using save
'app.para_BF_new' is not a valid variable name.
Error in SpehroidAnalysisApp/SaveButtonPushed (line 181)
save(app.filename,'app.para_BF_new','app.ROI')
Error in matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62)
newCallback = @(source, event)executeCallback(ams, ...
Error while evaluating Button PrivateButtonPushedFcn.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 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!