Update data from Google Sheets to MATLAB continuously
이전 댓글 표시
Hi guys. I come from Vietnam.
I have a few questions, hope someone can help.
- I use the code GetGoogleSpreadsheet to send data from Google Sheets to MATLAB.
- How to update data from Google Sheets to MATLAB continuously with just one click of "Run"? While GoogleSheet is always updating new data.
- Is it possible to create an infinite loop for GetGoogleSpreadsheet and set X seconds back to execute the loop again?
Someone help me cause i'm in a hurry!
Thank you very much! Good luck!


답변 (1개)
Walter Roberson
2021년 11월 21일
1 개 추천
When I look at the code at https://www.mathworks.com/matlabcentral/fileexchange/39915-getgooglespreadsheet it looks to me as if the code could be broken up so that you had an initialization phase that (I suspect) would only need to be done once. I suspect the rest of the code could be broken out so that you could call it to get a new update.
However, it looks to me as if the code probably needs to open a new https connection and fetch the entire contents each time. It might possibly the case that you could modify the code to only return certain ranges of data -- but if the idea happens to be that you are working collaboratively with someone then you would need to fetch the entire sheet anyhow as you do not know where they are modifying.
I am pretty certain that you cannot use this technology to ask "what is updated?" -- there might be other ways of doing that, maybe.
For continuous updates, your code would have to loop asking for an update.
When I look around, I do not find any way of asking for part of the document -- but perhaps I just did not look in the right place.
댓글 수: 2
Nguyen Trung Hieu
2021년 11월 22일
Walter Roberson
2021년 11월 22일
So what is the problem with writing
while true
result = getdata();
openvar('result');
sleep(10);
end
카테고리
도움말 센터 및 File Exchange에서 Installation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
