Quantcast
Channel: MATLAB Central Newsreader - converting int to float
Viewing all articles
Browse latest Browse all 7

Re: converting int to float

$
0
0
Brett wrote:
>
> Perhaps this question has been answered, but I wasn't able to find it.
> Supose I read in 4 numbers of int8, but then realize that this should
> be a float. Is there an easy way to do this?
>

d = double(a); % convert int8 array a to double-precision
f = single(a); % convert int8 array a to single-precision

I don't know if you really mean "float", which I think refers
to single-precision. Most of Matlab's functions require doubles.
But anyway single() will do it, if that's what you want.

          - Randy

Viewing all articles
Browse latest Browse all 7

Latest Images

Trending Articles





Latest Images