Error using urlread to get results from queries

2 visualizzazioni (ultimi 30 giorni)
Hello,
I'm doing some Freebase query (for example : https://www.googleapis.com/freebase/v1/mqlread?query={"type":"/people/person","id":"/en/albert_ii_of_belgium","children":[]})
and I want to get the result in matlab.
So I did :
urlread(https://www.googleapis.com/freebase/v1/mqlread?query={"type":"/people/person","id":"/en/albert_ii_of_belgium","children":[]})
but I had the following error :
Error using urlread (line 111)
Error downloading URL. Your network connection may be down or your proxy settings improperly configured.
I haven't got any network problem.
However, I can't figure out how to solve this problem.
My matlab version is R2012b (32 bits).

Risposta accettata

per isakson
per isakson il 13 Ott 2012
Modificato: per isakson il 13 Ott 2012
Doc says:
str = urlread(URL)
where URL is a Matlab string. You need to enclose the text by apostrophes to make it a Matlab string. This call (shortened to fit in one line) works here
str = urlread( 'https://www.googleapis.com/..._belgium","children":[]}' )
str =
{
"result": {
"type": "/people/person",
"id": "/en/albert_ii_of_belgium",
"children": [
"Philippe, Duke of Brabant",
"Prince Laurent of Belgium",
"Princess Astrid of Belgium, Archduchess of Austria-Este",
"Delphine Bo\u00ebl"
]
}
}

Più risposte (0)

Categorie

Scopri di più su Get Started with MATLAB in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by