Know if my script gets an error
1 view (last 30 days)
I am running a Matlab script in my Linux console and when it gets an error, the code continues its execution. Is there a way to stop the execution if an error occurs and not generate the outputs.
Thanks in advance,
Jan on 3 Oct 2017
What does "running a Matlab script in a Linux console" exactly mean? You can run Matlab scripts inside Matlab only. Then the command error stops the execution, except if you prevent the script from doing so by a try/catch block. If this happens, the solution is easy: Do not let the code proceed after a severe problem, but stop if by an error.
Without seeing the relevant part of the code or understanding where you run what, I cannot post a more specific answer.