MATLAB Answers


How to call a function from app designer? and also make it graph in the axes inserted in app designer

Asked by Laura Mazuera on 9 Dec 2018
Latest activity Commented on by Cris LaPierre on 9 Dec 2018
We have a function that works perfectly when we call it from the command window, the function takes a structure and graphs it components in the figure window. We want to be able to call it from app designer and make it graph the components in the axes inserted there instead of the figure window. Any recommendations?


Sign in to comment.

1 Answer

Answer by Cris LaPierre on 9 Dec 2018

You can call external function in app designer (see here). The challenge is going to be getting it to plot in the app. You could try adding an input to your function that is an axes handle. Then in your function, try specifying the axes handle in your plot command. When you call the function with the app axes handle, give it the app axes handle and see if it can plot to your app.

  1 Comment

Ok, was too curious not to test it myself. It works.
The external function
function plotToApp(x,y,h)
Calling it in app designer
function Button2Pushed(app, event)

Sign in to comment.