필터 지우기
필터 지우기

Animation graph with the slider

조회 수: 2 (최근 30일)
martin martin
martin martin 2019년 4월 10일
댓글: martin martin 2019년 4월 10일
Hello guys,
I have question, how can I animate this graph with slider? I just want to shift green point from the start to the end and again back (as on the picture) Any tips?
Best regards
clear, clc, close
t = linspace(0, 2*pi, 100);
x = sin(t);
% Set up first frame
h = figure('Color', 'white');
plot(t,x, 'LineWidth', 2)
xlabel('x')
ylabel('y')
hold on
h1 = plot(t(1),x(1),'go','LineWidth', 3, 'MarkerSize', 10);
for q = 1:length(t)
set(h1, 'XData', t(q), 'YData', x(q));
title(['Amplituda ', num2str(x(q)), ' mV.'])
pause(0.01)
end
for q = length(t):-1:1
set(h1, 'XData', t(q), 'YData', x(q));
title(['Amplituda ', num2str(x(q)), ' mV.'])
pause(0.01)
end
xxx.PNG
  댓글 수: 1
martin martin
martin martin 2019년 4월 10일
I tried simple GUI with only with axis and slider, but I don't know how to write it correctly.

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

답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by