Error using urlread to get results from queries

2 vues (au cours des 30 derniers jours)
Collet Bastien
Collet Bastien le 12 Oct 2012
Modifié(e) : per isakson le 11 Août 2017
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).

Réponse acceptée

per isakson
per isakson le 13 Oct 2012
Modifié(e) : per isakson le 13 Oct 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"
]
}
}
  1 commentaire
lotus whit
lotus whit le 11 Août 2017
i did as Doc said but the error still appeared . any idea?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by