Cody

Solution 214908

Submitted on 9 Mar 2013 by Alex P.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
%% A = 1; assert(isequal({1},replace_zeros_and_NaNs(A)))
2   Pass
%% A = [1 0; NaN 1]; C_correct = {1, 'error'; 'error', 1}; assert(isequal(C_correct, replace_zeros_and_NaNs(A)))
3   Pass
%% A = []; assert(isequal({}, replace_zeros_and_NaNs(A)))
4   Pass
%% A = magic(5); A([14 3 5 6 7]) = 0; A([1 18 15 20 22]) = NaN; C_correct = {'error' 'error' 1 8 15; 23 'error' 7 14 'error';'error' 6 13 'error' 22; 10 12 'error' 21 3; 'error' 18 'error' 'error' 9}; assert(isequal(C_correct, replace_zeros_and_NaNs(A)))