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 次查看(过去 30 天)
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

采纳的回答

Mario Malic
Mario Malic 2020-10-1
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 个评论
Mario Malic
Mario Malic 2020-10-1
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

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by