Hello, Luca Fenzi. This looks like an interesting problem. However, it can still be improved a bit. (1) It is recommended that at least four test cases be provided, though more are often necessary to prevent hard-coded workarounds. (2) The Test Suite does not rigorously check the individual elements of the output vector, only their sum; that leaves it open to passing completely incorrect submissions as demonstrated in Solution 1575892. (3) In the Problem Statement, it is highly unlikely that the output would be exactly [4, -1]; the presence of random perturbations means that the output might be [4.3, -1.2] or [3.9, -0.8], say. Although there is a suitable allowance in the Test Suite for 'random' variation in the outputs, it would still be advisable to amend the Problem Statement. —DIV
Find all elements less than 0 or greater than 10 and replace them with NaN
13139 Solvers
555 Solvers
323 Solvers
Matlab Basics II - 3 Dimensional Arrays
89 Solvers
314 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!