MATLAB: Problems of loading http urls in matlab.

downloadinterneturlreadwebwget

I can access websites using the matlab web browser.
I can NOT download a url link using 'urlread'.
Is there any other matlab function to download the text of a url link?
Another alternative way is to use wget in matlab. I know how to save the url to a local text file and then read it into matlab, but it's inefficient since I have plenty of urls to read. Is there any way I can assign the wget-downloaded text to a variable in matlab straightforwardly?

Best Answer

Is an error being thrown when you used urlread, or is it just that the output is an empty string? What is the line of code that you are using to access the web content?
I don't have wget but (on my Mac) I use curl and can save the output from the call to a variable as per the system examples
% build the command string
cmd = ['curl ' 'http://www.mathworks.com/matlabcentral/answers'];
% execute the command
[status,cmdout] = system(cmd);
% what is the output?
cmdout
Try the above and see what happens!
Related Question