MATLAB: How to properly call a public function within an App Designer generated class

app designerMATLABpublic function

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 1000×1 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

Best Answer

s = SoundGen_GUI
GUI_plot(s, ssm) % or s.GUI_plot(ssm)
Related Question