MATLAB: How to set a proxy server to use with the URLREAD and URLWRITE functions in MATLAB as of R2010b

com.mathworksMATLABPROXYserverupward compatibilityurlread

In R2010a as explained in the technical solution:
it was possible to use the following command:
jobj = com.mathworks.mlwidgets.html.HTMLPrefs;
As of R2010b, the same command returns the following error message:
??? No constructor 'com.mathworks.mlwidgets.html.HTMLPrefs' with matching signature found.
Which command do I have to use as of 10b?

Best Answer

I have just found a workaround.
The following lines are from the above technical solution 1-19J5C: How do I set a proxy server to use with the URLREAD and URLWRITE functions in MATLAB? :
if isdeployed
jobj = com.mathworks.mlwidgets.html.HTMLPrefs;
setUseProxy(jobj,1)
setProxyHost(jobj,'HostName')
setProxyPort(jobj,'Port')
end
In fact we could write these lines as follows:
if isdeployed
com.mathworks.mlwidgets.html.HTMLPrefs.setUseProxy(true)
com.mathworks.mlwidgets.html.HTMLPrefs.setProxyHost('HostName')
com.mathworks.mlwidgets.html.HTMLPrefs.setProxyPort('Port')
end
And these lines work within R2010a and R2010b .