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

Re: converting int to float

$
0
0
grantb@sysmatrix.net (Brett) wrote in message <3c728109.94361390@svlnews.lmms.lmco.com>...
> 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?
>
> Thanks,
> Brett
>

Here's what I do:

typecast(x, 'single')

If x was read in as an int8 but stored as a double, try the following:

typecast(int8(x), 'single')

Viewing all articles
Browse latest Browse all 7

Latest Images

Trending Articles





Latest Images