You can write as many zeros as you want after 12358470000.0, it's still the same number as 12358470000
what is the problem with the following solution bro !
% roundn(x,2)
Check,it's the same as round(x,2).
y = round(x,-4);
Interesting problem
The problem needs correction. Rounding to nearest 10,000 means no body cares about .000 values. y_correct = 12358470000.000; should be y_correct = 12358470000.
nice
function y = round_ten_thou(x)
y = round(x/1e4)*1e4;
end
Find all elements less than 0 or greater than 10 and replace them with NaN
13059 Solvers
Back to basics 12 - Input Arguments
525 Solvers
Who knows the last digit of pi?
557 Solvers
Solving Quadratic Equations (Version 1)
427 Solvers
365 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!