How to use RESTful webservices in Matlab

前端 未结 2 2110
傲寒
傲寒 2021-01-03 04:12

I have a data provider that provides a web-based RESTful interface. I\'m trying to get that data into Matlab. The interface is relatively simple, but I\'m still looking for

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-03 04:46

    If the RESTful interface returns JSON, it looks like it's as easy as installing a little plugin:

    http://www.mathworks.com/matlabcentral/fileexchange/20565

    and ((almost) direct from the readme of that plugin):

    google_search = 'http://ajax.googleapis.com/....'; 
    matlab_results = parse_json(urlread(google_search));
    

    I guess that's a nice thing about RESTful interfaces over SOAP or whatever is that you don't need excessive machinery to deal with it. I'm sure if the interface isn't returning JSON it will be something similar you can parse.

提交回复
热议问题