while creating figure based app in MATLAB, how to give callback to another matlab code?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am working on to create figure based app, standalone application in MATLAB for plotting graphs from load data.
let me give brief explanation of my work,
There are two push buttons, 'Load data' and 'Plot data' from where I can load data and then it will plot the data in given location like shown in figure.
I have matlab code ready which imports data from excel file and then it plot the data. here my question is Can I callback this matlab code to push buttons and plot the data in GUI?
and if we cannot callback matlab code then how can import all data with 'Load data' push button?
0 comentarios
Respuestas (2)
Geoff Hayes
el 26 de Abr. de 2021
Ashwini - yes, you should be able to use your other MATLAB code depending upon how it is written. You will want it to be a function so that you can pass in the data and/or filename (of the data to import) and pass in the axes handle where you want to plot the data.
2 comentarios
Image Analyst
el 26 de Abr. de 2021
For 1., how are you calling it? Evidently you're doing something like
[Engine_Speed, Engine_Power_ON, Engine_Power_OFF, Gear_One, Gear_Two] = LoadData();
If you do that you need to define output arguments:
function [Engine_Speed, Engine_Power_ON, Engine_Power_OFF, Gear_One, Gear_Two] = LoadData()
Image Analyst
el 26 de Abr. de 2021
Your pushbutton callback can call other functions. Just make sure the function is in the mlapp or .m file, or on the search path, or in the same folder as your app. It should work then.
0 comentarios
Ver también
Categorías
Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!