How to use webread to download numerical data

조회 수: 1 (최근 30일)
David Koenig
David Koenig 2018년 8월 13일
댓글: Christian Heigele 2018년 8월 14일
Hello. I have data in the form of .mat files in a folder in my Boxnet account. I would like to use a Matlab script to read those .mat files. One of those files is A0#.mat. When I use InternetExplorer to open my Boxnet folder I see
https://app.box.com/folder/3917214121
so I assume that is the link to the folder containing A0#.mat.
I have tried
url='https://app.box.com/folder/3917214121';
webread(url);
which does not give me an error but it also does not give any data.
I have tried
url='https://app.box.com/folder/3917214121/A0#.mat';
webread(url);
which gives me an error. Could someone suggest what I am doing incorrectly. Thanks.
  댓글 수: 2
David Koenig
David Koenig 2018년 8월 13일
I am still trying to access data in a Boxnet folder. I notice in the "help webread" example there is the following:
api = 'http://climatedataapi.worldbank.org/climateweb/rest/v1/';
url = [api 'country/cru/tas/year/USA'];
When I run the example, it works but when I try to use Internet Explorer to go directly to http://climatedataapi.worldbank.org/climateweb/rest/v1/
I get a "not found" error. Therefore, could someone explain what 'country/cru/tas/year/USA' does or what it is?
Thanks.
Christian Heigele
Christian Heigele 2018년 8월 14일
With [api 'string'] you are concatting the two strings into:
This address is valid and a `webread('http://climatedataapi.worldbank.org/climateweb/rest/v1/country/cru/tas/year/USA')` should return you a 112x1 struct.

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

채택된 답변

Christian Heigele
Christian Heigele 2018년 8월 13일
Most likely your missing your credentials:
options = weboptions('Username','jdoe','Password','mypassword'); webread(url, options);
See https://ch.mathworks.com/help/matlab/ref/weboptions.html for more details.
  댓글 수: 1
David Koenig
David Koenig 2018년 8월 13일
Christian, thanks for your answer. I tried it and it does not work.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by