Convert uint8 vector to float
Show older comments
Hi All,
i have a .mf4-measurement data in uint8:
1×20 uint8 row vector
132 132 132 132 132 132 133 133 133 133 134 138 170 214 222 226 224 216 215 215
is there a way to convert it to these physical values (float)?
0.01 0.01 0.01 0.01 0.01 0.01 0.02 0.02 0.02 0.02 0.03 0.07 0.39 0.83 0.91 0.95 0.93 0.85 0.84 0.84
Thank u and kind regards,
2 Comments
Normally this would be as simple as converting the input data to double and multiplying by a scale factor. Your example values, however don't have a simple linear relationship between the input data and the example output data (see below).
Can you clarify how your example "physical values" were generated?
in = uint8([132 132 132 132 132 132 133 133 133 133 134 138 170 214 222 226 224 216 215 215])
out = [0.01 0.01 0.01 0.01 0.01 0.01 0.02 0.02 0.02 0.02 0.03 0.07 0.39 0.83 0.91 0.95 0.93 0.85 0.84 0.84]
SF = out./double(in)
plot(SF)
grid on
Accepted Answer
More Answers (0)
Categories
Find more on Logical 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!
