Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3964662
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:21:40+00:00 2026-05-20T03:21:40+00:00

In MATLAB (r2009b) I have a uint32 variable containing the value 2147484101. This number

  • 0

In MATLAB (r2009b) I have a uint32 variable containing the value 2147484101.

This number (its 4-bytes) has been extracted from a digital machine-vision camera in a grabbing process. According to what I understand it holds the single-precision form of the shutter-speed of the camera (should be close to 1/260s = 3.8ms).

How do I convert this 32-bit number to its IEEE single-precision floating-point representation – using what’s available in MATLAB?

With mentioned value in variable n, I have tried using a combination of nn=dec2hex(n,16) and then hex2num(nn). But it seems that hex2num expects the hexadecimal coding to be double-precision and not single as it is here. Atleast I am getting weird numbers with this method.

Any ideas?

Edit: Tried @Matt’s answer below:

typecast(uint32(2147484101),'single') %# without swapbytes
typecast(swapbytes(uint32(2147484101)),'single') %# with swapbytes

Which gives:

ans =

  -6.3478820e-043

ans =

  -2.0640313e+003

I tried the IEEE 754 converter (JAVA applet) at http://www.h-schmidt.net/FloatApplet/IEEE754.html.

Using:

format hex
typecast(uint32(2147484101),'uint8') %# without swapbytes
typecast(swapbytes(uint32(2147484101)),'uint8') %# with swapbytes

gives

ans =

   c5   01   00   80

ans =

   80   00   01   c5

Entering these bytes into the applet (hexadecimal) gives me the same numbers as MATLAB.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T03:21:41+00:00Added an answer on May 20, 2026 at 3:21 am

    I think what you’re saying is that the underlying bits represent a floating point number, but that you’ve got it stored as a uint32.

    If that’s that case, you can cast it (i.e. reinterpret the bits) as a single precision float using the typecast() function.

    b = typecast(a, 'single')
    

    where a is your variable.

    See:
    http://www.mathworks.com/help/techdoc/ref/typecast.html

    Edited: not the cast function, the typecast function… My apologies!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple Matlab versions installed on my PC. To say, R2006b, R2009b, R2010a.
My knowledge of matlab is merely on a need to know basis, so this
I have a MATLAB class which contains a reference to a java object classdef
I need MatLab for 2D and 3D modeling. I have little experience in MatLab.
I have a 30000x14000 sparse matrix in MATLAB (version 7), which I need to
Matlab R2009b introduced a new operator - ~ - to symbolize an unused function
I have noticed that MATLAB provides the BLAS and LAPACK headers among others: $
I'm trying to connect to MySQL using MATLAB R2009b 64 bit and the mysql.cpp
I have a mex64 dll compiled on my machine. I used Matlab 2009b with
I've been integrating simple java modules into the MATLAB environment on Windows with some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.