Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

matlab help to read a textfile

Status
Not open for further replies.

knight_rider007

Newbie level 1
Newbie level 1
Joined
Aug 21, 2013
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
6
hi all,
I am new in matlab,
I wish to read a textfile with 32bit unsigned values,I wish to read first bit of every value and need to write it on on another text file
somebody pls give me suggestions
 

filename = 'xxxx.txt'
data = load(filename)
data_bin = dec2bin(data)
...
after that you can access by array indexing..

data_bin(i,end) is the first bit of the i-th value (located at index i)..

or you can use mod(data(i), 2).. which gives whether the value is even or odd.. even means first bit is zero.. odd means first bit is one.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top