How to get current point at certain time points?

Hi!
I would like to set a sampling rate of get(gcf, 'currentpoint') to such that I would get the current point let's say in every half second. My current script is:
cp=get(gcf,'currentpoint');
t=timer;
set(t,'executionMode','fixedrate');
set(t,'period',.5);
set(t,'timerfcn',cp);
start(t);
However, this doesn't work. I get an error that says: TimerFcn callback must be set to a string, a function handle, or a 1-by-N cell array.
How to fix my script?

 채택된 답변

Walter Roberson
Walter Roberson 2015년 9월 24일

0 개 추천

curfig = gcf;
cp = @(src,event) get(curfig,'currentpoint');
But once you have fetched it, what are you going to do with it?

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Model, Block, and Port Callbacks에 대해 자세히 알아보기

질문:

lou
2015년 9월 24일

답변:

2015년 9월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by