on error
1 回表示 (過去 30 日間)
古いコメントを表示
Hello, I connect to an external db. If the ping fails, I would like matlab to execute a certain code. so something in the form
ping(C)
if "invalid connection" then .... end
...
How can I do this in Matlab? Thanks
0 件のコメント
採用された回答
Bob Hamans
2011 年 7 月 5 日
You could attempt to open the connection and if that fails execute a different piece of code. See the documentation:
try
MATLAB commands % Try block
catch ME
MATLAB commands % Catch block
end
0 件のコメント
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!