필터 지우기
필터 지우기

How to plott graph in Appdesigner from MATLAB

조회 수: 2 (최근 30일)
Mihir Rathod
Mihir Rathod 2021년 12월 4일
댓글: Mihir Rathod 2021년 12월 4일
Hello everyone,
I have created a Function in MATLAB, That plots 3 graph (which i have mentioned) in the Function. Now, in the app desginer, i want to to call that function or i have to do the same plotting in the axes, after trying alot, i am unable to solve it.
This is the Function that i Creates in the MATLAB :
Now, i want to plott this graphs in appdesiner but, it is showing me in another window, when i click on run and not in the Axes.
This are the changes that i made in Code view :
Can anyone please help me with this thing?

채택된 답변

Julius Schroers
Julius Schroers 2021년 12월 4일
First you need to create an Axes, I don't know if you have already done that. The important thing is that you also have to specify where you want to plot in the AppDesigner. Also the commands for grid, hold and so on are different in AppDesigner, because you have to define the target.
I have adapted a few things as an example:
function Plot_graph(app)
fplot(app.UIAxes,@(x) sin(x),[-2 2],"LineWidth",2)
hold(app.UIAxes,"on")
fplot(app.UIAxes,@(x) cos(x),[-2 2],"--or")
grid(app.UIAxes,"off")
hold(app.UIAxes,"off")
end
  댓글 수: 1
Mihir Rathod
Mihir Rathod 2021년 12월 4일
Ahh okay, it worked, so basically i have written it in wrong format, i just thought that the commands are same as if in MATLAB.
Thank you very much for your support.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by