Fix the error with "Error using urlread'
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi,
I am using MATLAB with apm (APMonitor) to find the parameters of an equation but I got an error :
"Error using urlread
The value of 'url' is invalid. Expected input to be one of these types:
char
Instead its type was java.net.URL."
Does anyone knows how to fix this?
Thank you in advance
% Add APMonitor toolbox available from
% http://apmonitor.com/wiki/index.php/Main/MATLAB
addpath('apm')
% server and application
s = 'http://byu.apmonitor.com';
a = 'regression';
% clear any prior application
apm(s,a,'clear all');
% load model and data files
apm_load(s,a,'model.apm');
csv_load(s,a,'data.csv');
% configure parameters to estimate
apm_info(s,a,'FV','a');
apm_info(s,a,'FV','b');
apm_info(s,a,'FV','c');
apm_option(s,a,'a.status',1);
apm_option(s,a,'b.status',1);
apm_option(s,a,'c.status',1);
apm_option(s,a,'nlc.imode',2);
% solve nonlinear regression
output = apm(s,a,'solve');
disp(output)
댓글 수: 0
답변 (1개)
Cris LaPierre
2022년 9월 1일
Assuming you are trying to run the example_nlc demo files that come with APM, I was unable to duplicate your error. Is your path to the APM folder correct taking into consideration your current folder? Is your current folder correct?
Can you provide more details?
unzip apm_matlab_v0.7.2.zip
cd('example_nlc')
% Add APMonitor toolbox available from
% http://apmonitor.com/wiki/index.php/Main/MATLAB
addpath('../apm/')
% server and application
s = 'http://byu.apmonitor.com';
a = 'regression';
% clear any prior application
apm(s,a,'clear all');
% load model and data files
apm_load(s,a,'model.apm');
csv_load(s,a,'data.csv');
% configure parameters to estimate
apm_info(s,a,'FV','a');
apm_info(s,a,'FV','b');
apm_info(s,a,'FV','c');
apm_option(s,a,'a.status',1);
apm_option(s,a,'b.status',1);
apm_option(s,a,'c.status',1);
apm_option(s,a,'nlc.imode',2);
% solve nonlinear regression
output = apm(s,a,'solve');
disp(output)
댓글 수: 3
Cris LaPierre
2022년 9월 1일
Also, you do not need to copy the apm folder. Just use the full path to the original folder in the addpath command. Consider saving the changes to your path so that you do not have to do this every time. See here: https://www.mathworks.com/help/matlab/matlab_env/add-remove-or-reorder-folders-on-the-search-path.html
참고 항목
카테고리
Help Center 및 File Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!