I would like to store a variable as an output from a function in App Designer for use with other functions. Please see the simple example below.
properties (Access = private) x = linspace(0,1,10); % Description
end methods (Access = private) function [y] = func(app) A = app.EditField.Value; B = A + 1; y = app.x.^2 + B; plot(app.UIAxes,app.x,y) end
I wish to use the variable 'y' from func(app) for use within the second function, func2(app).
func2(app) plot(app.UIAxes2,app.x,y) end end
Any help would be appreciated, the example is trivial as both plots plot the same graph. I am just unaware of the syntax required as the App Designer environment has slight modifications from that of the usual MATLAB workspace.
Any help would be very appreciated,
Sam
(Using R2017b)
Best Answer