change floating number in a column matrix
Show older comments
I have data with DAT format file. In third column there is float 1.70141E+38, can i get change this float to 0 value?
1 Comment
KSSV
on 10 May 2023
Why you want to change?
Answers (2)
realmax('single')
ans/2
which matches the number you indicated. It is not immediately clear why anyone would use half of the maximum as a signal value, so maybe it is an accident.
Anyhow, you can try something like
YourArray(YourArray > 1.7e+38) = 0;
Steven Lord
on 10 May 2023
0 votes
I'm guessing whoever or whatever wrote that file intended that to be a "missing" value or it's an outlier. The functionality in MATLAB for cleaning data (the Clean Missing Data and Clean Outlier Data live tasks and the functions in the "Missing Data and Outliers" category on this documentation page) may be of use to you in removing this missing or outlier data.
Categories
Find more on Whos in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!