MATLAB: Using sign(x) with -0.00

-0.00formatssign

Hi, I need to go through a vector and check the sign of an oscillatory function but I have a lot of -0.0000's at the start which is going to mess up what I need to do.
Is there anyway to convert them to 0.000 rather than -0.000?
Thanks

Best Answer

Matlab does not have a -0.0, therefore what you are seeing must be a -0.000000000000001 or similar, which is hidden by the display format. To see more digits type this in the command window:
format long g
If you have good reasons to claim, that these data are pure noise, you can smooth it:
x(abs(x) < 1e-10) = 0.0;
But be sure to note the physical motivation of the threshold value.