필터 지우기
필터 지우기

Passing values between two guis and plotting

조회 수: 1 (최근 30일)
Safouane Chergui
Safouane Chergui 2017년 7월 28일
댓글: Safouane Chergui 2017년 7월 28일
I have a couple of guis. The first one is called figure1 and the second figure2. The first one includes a slider. The value of that slider should be used to plot a sine function on an axis in the second gui. In the slider callback, I've written the following lines of code :
h=findobj('Tag','figure2');
figure2_data=guidata(h);
x=get(handles.slider1,'Value')
t=0:0.1:10;
plot(figure2_data.axes1,x,sin(x*t));
The values on the x-axis get changed when I move the slider but nothing is plotted on the axis. Can anyone help me understand what's wrong with my code?

답변 (1개)

Vipresh Gangwal
Vipresh Gangwal 2017년 7월 28일
try adding drawnow after you call plot function. Please note that I have not tried this, just guessing that this might work.
https://www.mathworks.com/help/matlab/ref/drawnow.html
  댓글 수: 1
Safouane Chergui
Safouane Chergui 2017년 7월 28일
Thank you for your answer. Unfortunately, it doesn't work. I think the axis handles is does get updated as the x-axis scale gets changed... So I don't believe it's a matter of updating the plot

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

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by