Problem 2670. Error handling

Solution 527953

Submitted on 13 Nov 2014 by rifat
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
%% for ii=1:100 x = rand; try y = check(x); catch y = 'error'; end end assert(isequal(y,x))

2   Pass
%% for ii=1:100 x = -rand; try y = check(x); catch y = 'error'; end end assert(isequal(y,'error'))

Suggested Problems

More from this Author44

Community Treasure Hunt

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

Start Hunting!