try
try is used in try-catch blocks and is the code that is executed first in the sequence of the try-catch block. If there is an error in the try block, control is passed to the catch block, where exceptions are handled.
Syntax
try (codeToExecute)
Inputs
- codeToExecute
 - Code to be executed in the try block.
 
Example
try
    a = 1;
    b = a * 2;
    printf('No errors in try block')
catch
    printf('Errors found in try block');
end
      No errors in try block