MATLAB: Using try/catch to get warning message

catchtry

What o I have to do in order to get rid of the message in ode45 line 309 (error tolerance message). I use try and then I put the ode45(……) and eventually I`ll have a warning message about the tolerance for integration on the screen but I do not want this warning poping up all the time so I save the line 309 in ode45 and put it in a catch statement but it didnt work. Can you guys help me with that.

Best Answer

You can turn off specific warning messages via the warning command:
S = warning('MATLAB:ode45:IntegrationTolNotMet', 'off');
... add your ode call here ...
warning(S);
Related Question