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?

조회 수: 16 (최근 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에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by