How can I draw a graph using a button?
조회 수: 6 (최근 30일)
이전 댓글 표시
Hello everyone, I want to draw a graph when I press the button, but a new plot is created. I want to plot the axeste next to the button. How can I do it?

% Button pushed function: Button
function ButtonPushed(app, event)
X=1:5;
Y=1:5;
plot(X,Y)
end
end
댓글 수: 0
채택된 답변
Voss
2022년 6월 1일
You need to tell the plot function to plot into your axes:
plot(app.UIAxes,X,Y)
If your axes is called something besides app.UIAxes, use that name instead.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!