Redian新闻
>
What's wrong with this piece of Matlab code? (about Exception throwing)
avatar
c*n
2
try
[path_pts,path_length]=function_handle(...);
if path_length < 0
ME = MException('InputError', 'dest in room');
throw(ME);
end
catch e
test.runtime_errors(ii) = true;
disp(e.message)
end
The error information is as follows:
??? Undefined function or variable 'e'.
Error in ==> mymain at 49
catch e
avatar
l*i
3
http://www.caspur.it/risorse/softappl/doc/matlab_help/techdoc/matlab_prog/ch
10_p45.html#error_checking_with_trycatch
try/catch就好了,你的e人家不懂的

【在 c*********n 的大作中提到】
: try
: [path_pts,path_length]=function_handle(...);
: if path_length < 0
: ME = MException('InputError', 'dest in room');
: throw(ME);
: end
: catch e
: test.runtime_errors(ii) = true;
: disp(e.message)
: end

avatar
l*g
4
you are trying to run a piece of code designed for r2007b or above in an
earlier version.

【在 c*********n 的大作中提到】
: try
: [path_pts,path_length]=function_handle(...);
: if path_length < 0
: ME = MException('InputError', 'dest in room');
: throw(ME);
: end
: catch e
: test.runtime_errors(ii) = true;
: disp(e.message)
: end

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。