How do I properly call a public function within an App Designer generated class?

7 次查看(过去 30 天)
Hello
I made a really simple app in App designer that I want to use to plot a graph
The relevant code inside the app designer file (SoundGen_GUI.mlapp) is
methods (Access = private)
end
methods (Access = public)
function GUI_plot(app, ssm)
plot(app.UIAxes, ssm);
end
end
where ssm is a 1000x1 array
In another separate script (SoundGen.m) I use the
SoundGen_GUI.GUI_plot(ssm);
The error message I recieve is
The class SoundGen_GUI has no Constant property or Static method named 'GUI_plot'.
Error in SoundGen (line 122) SoundGen_GUI.GUI_plot(ssm);
I cannot figure what I am doing wrong. Am I calling the function in an improper way or is there something I should add to the SoundGen_GUI.mlapp code? Can someone please give me some insight? Thanks in advance

采纳的回答

Sean de Wolski
Sean de Wolski 2018-1-31
s = SoundGen_GUI
GUI_plot(s, ssm) % or s.GUI_plot(ssm)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Linear Model Identification 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by