Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: How to convert float32 bit little endian to unisgned 16bit big endian?
Replies: 1   Last Post: Feb 10, 2013 10:40 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Siti_Mustaqim

Posts: 17
Registered: 6/15/12
How to convert float32 bit little endian to unisgned 16bit big endian?
Posted: Feb 9, 2013 2:45 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi,
I am very much welcome for any comments on this subject. I tried with this command. Is it correct?
############################
clear all; clc;
fid = fopen('cuba1_act_av.bin', 'rb','ieee-le');
B=fread(fid,inf,'float32');
fclose(fid);
fid2 = fopen('NCATAsim_act.bin','wb','ieee-be');
fwrite(fid2,B,'uint16');
fid3=fopen('NCATAsim_act.bin','rb','ieee-be');
test=fread(fid3,10000,'uint16');
############################
Please help.

Thank you
Siti



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.