In App designer how to plot multiple plot on a same figure if one variable value coming from a function and also its value changes with output of function?

17 visualizzazioni (ultimi 30 giorni)
Hello, i m writing a code in Matlab App Designer if i ask in simple words lets say a = 0:0.1:2*pi;
and i want to plot it with row vector 'b' value lets say b = 0:1:90; , so its simple to use plot(a,b;)
but if value of 'b' variable is row vector coming from the output off a function then lets say i use b = function(name) then plot (a,b) this do well...
problem comes when some time my function once generate values for variable 'b' and some time twice, in case of twice it overwrites variable 'b' value.
How can i use Both Values for Variable 'b' for plot with Variable 'a' on same figure.
kindly guide how can i write proper code. Thanks

Risposta accettata

Mario Malic
Mario Malic il 1 Ott 2020
On the UIAxes, check the right hand side, Multiple plots - Next Plot - Add. If this doesn't work then write more on this: problem comes when some time my function once generate values for variable 'b' and some time twice, in case of twice it overwrites variable 'b' value.
  2 Commenti
Mario Malic
Mario Malic il 1 Ott 2020
Dear Sadiq, there are no requests here, just questions, answers and comments.
What I have written, actually works, so I am repeating it here. Multiple plots - Next Plot - Add
% Programmatically, in startupFcn
hold (app.PulsePlotUIAxes, 'on')
You will also need to add the button with the callback to clear the axes
% Button pushed function: Button
function ButtonPushed(app, event)
cla(app.PulsePlotUIAxes)
end

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Line Plots in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by