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?

13 visualizaciones (últimos 30 días)
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

Respuesta aceptada

Mario Malic
Mario Malic el 1 de Oct. de 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 comentarios
Mario Malic
Mario Malic el 1 de Oct. de 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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by