on error
조회 수: 3 (최근 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!