Using a URL with square brackets in MatLab -


i using webread download data restful web service. url constructed as:

'http://someurl/service.php?query=data&options'

one of options '&includesensors[]=xxx' xxx sensor type. option fails because matlab converts square brackets '&includesensors%5b%5d=xxx'

any idea on how matlab pass option without messing it?

my mistake build url , passing on webread, like:

url = 'http://someurl/service.php?query=data&includesensors[]=xxx' data = webread(url); 

which results in options (including '[]') being passed urlencode (i'm guessing)

but proper way is:

url = 'http://someurl/service.php'; data = webread(url,'query','data','includesensors','xxx'); 

which works properly.


Comments