Why does my try-catch statement not catch an exception?

조회 수: 2 (최근 30일)
Klas
Klas 2015년 11월 18일
I have a problem with a function that reads text-files and stores the results in mat-files. Sometimes an exception occurs and the function stops. When I restart MATLAB, the function then can proceed and read the file. I want to solve this with a try-catch statement. But when my function (xmlfolder2mat) crashes the catch statements are not invoked. Here is a short example:
>> try, xmlfolder2mat, catch, disp('Hello'); end
Loading folder 1 of 56
Caught "std::exception" Exception message is:
Message Catalog MATLAB:FileIO was not loaded from the file. Please check file location, format or contents__
However, as mentioned above. When I restart MATLAB the program continues on and reads the current file wihtout.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Scope Variables and Generate Names에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by