structure usage in public function in App-designer

1 次查看(过去 30 天)
I met a problem while assigning a variable to structure in App-designer:
methods (Access = public)
function plottest(app,WorkingDir)
tmp=3;
result.a=tmp;
end
end
but Matlab reported error: The expression to the left of the equals sign is not a valid target for an assignment.
however, when I revise it like this:
methods (Access = public)
function plottest(app,WorkingDir)
tmp=3;
result=tmp;
end
end
the problem does not exist anymore.
The reason I want to use structure is that, I have lots of variables that need to save at the end of this function, saving them one by one works but not as well as saving them into one structure.
just want know what is the problem here. is there anyway to resolve it?
Thanks!
Yu

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by