A = rand(3); B = magic(4); try C = [A; B]; catch ME ME.identifier ME.message ME.stack ME.cause getReport(ME) end
a = 10; try assert(a > 100) catch ME ME.identifier ME.message ME.stack ME.cause getReport(ME) end
n = 10; try if n < 100 error('%d is less than 100 ...', n); end catch ME getReport(ME) end