Error using urlread to get results from queries

2 ビュー (過去 30 日間)
Collet Bastien
Collet Bastien 2012 年 10 月 12 日
編集済み: per isakson 2017 年 8 月 11 日
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).

採用された回答

per isakson
per isakson 2012 年 10 月 13 日
編集済み: per isakson 2012 年 10 月 13 日
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 件のコメント
lotus whit
lotus whit 2017 年 8 月 11 日
i did as Doc said but the error still appeared . any idea?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by