nice
function y = round_ten_thou(x)
y = round(x/1e4)*1e4;
end
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
x = 12358466243;
y_correct = 12358470000;
assert(isequal(round_ten_thou(x),y_correct))
ans =
1.2358e+10
|
2 | Pass |
%%
x = 12358466243.325;
y_correct = 12358470000.000;
assert(isequal(round_ten_thou(x),y_correct))
ans =
1.2358e+10
|
Find all elements less than 0 or greater than 10 and replace them with NaN
13047 Solvers
3063 Solvers
462 Solvers
376 Solvers
664 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!