automatic refresh webread data
4 次查看(过去 30 天)
显示 更早的评论
hello everybody
I have a webread data (XXX are confidential):
https://api.XXXXXXXX.com/time_series?apikey=XXXXXXXX&interval=1min&symbol=EUR/USD&timezone=Europe/Rome&end_date=2023-02-14 09:37:00&start_date=2023-02-13 09:37:00&format=CSV')
that I save as table in workspace and analyze it.
how can I get an automatic refresh every 1 minute to this url without copy and launch it manually on command window?
tks very much
0 个评论
回答(4 个)
Jonas
2023-2-13
编辑:Jonas
2023-2-13
create a timer object, use a method for repeated execution and add the callback
EDIT:
e.g.
function doStuff()
intervalInS=10;
myData=[];
everyNowAndThen = timer("Period",intervalInS,"ExecutionMode","fixedRate","TimerFcn",@refresh);
everyNowAndThen.start();
function refresh(~,~)
myData=webread('https://de.mathworks.com/help/daq/troubleshooting-tips.html');
disp('next one')
end
end
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!