How to run/execute a MATLAB live script or function from App designer?



This video shows the steps to run a MATLAB Live script/ function from your App designer code. In this video it creates demo live script and function. Then execute them from MATLAB command line and App Designer’s code using the file name.

I hope you like this video. For any questions, suggestions or appreciation please contact us at: https://programmerworld.co/contact/ or email at: [email protected]

Complete source code and other details of this video are posted in the below link:

How to run/execute a MATLAB live script or function from App designer?

However, the main code is copied below also for reference:

Initialize Array
x = 2:3:50;

Plot the Array
plot(x);

/**************/

Live Function
function LiveFunctionExample(step)

y = 2:step:50;

assignin(“base”,”y_base”,y);

plot(y);

end

/*************/

% Callbacks that handle component events
methods (Access = private)

% Button pushed function: LiveScriptButton
function LiveScriptButtonPushed(app, event)
LiveScriptExample;
end

% Button pushed function: LiveFunctionButton
function LiveFunctionButtonPushed(app, event)
LiveFunctionExample(8);
end
end

One thought on “How to run/execute a MATLAB live script or function from App designer?

Leave a Reply

Your email address will not be published.