Marcallus
Marcallus

Reputation: 15

Octave: How do I convert urlread output to a struct

I’m running Octave 5.1.0

In Matlab you can use webread to get a struct from a web page, like this:

data=webread(urlString);

data is then a struct ready to use. (urlString specifies that the format should be json, but I can also get the data in xml format from this web page).

Can I achieve this in Octave? (I can’t use Matlab for this project).

I tried using

data=urlread(urlString);

data is then in string format. I could use regexp to extract the information I need, but I’m hoping there is an easier way.

I’ll be grateful for any suggestions.

Upvotes: 1

Views: 399

Answers (1)

Andrew Janke
Andrew Janke

Reputation: 23858

Core Octave does not support JSON reading and writing (yet), but there are a few packages that do so. Try one of them.

Upvotes: 1

Related Questions