How to use external function to plot a graph in GUI or app designer
20 views (last 30 days)
Currently I can only write the plotting command inside the code view of my GUI form. In cases where I need to write multiple commands for plotting it could better to have an external function that plots the graphs into the GUI form.
but nothing happens in my app form. What am I doing wrong?
Cris LaPierre on 5 Dec 2020
Edited: Cris LaPierre on 11 Dec 2020
A couple things stand out. First, your function has no inputs, so app, x, and y do not exist within the scope of your function. Next, your syntax for plotting in an app is incorrect. See here.
Once your syntax is fixed, just make sure your plotting function is either in the same folder as the app or on you MATLAB Path. See here for more.
With an app, there is no need to define an external function .You can create helper functions inside the app.