Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

How to use Timer in Matlab

I want use matlab to get IBM price from yahoo price can get by

quote = fetch(yahoo, 'IBM', 'Last');
px = quote.Last;

Now I want to retrieve the data every minute from, for example, 9:00 am to 1:00 pm. I would like to use timer object to get my data.

However, I cannot figure out how to use it. What I can get is

t = timer;
t.ExecutionMode = 'fixedRate';
t.Period = 60;

especially the timerFcn, I don't get how to use it.

Hope someone can write me an example with this. Thanks

Answer*

Cancel