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.

fread,fwrite ubit MATLAB

Status
Not open for further replies.

BleuPearl

Newbie level 1
Joined
Jan 22, 2012
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,288
Hi,,,I want to write a vectr in file,,but i don't know how do it. i must write element of my vector in different size bit for exemple:
aray=[152 12 100 10 65 2 212 11];
fid=fopen('data.txt','w');
for ii=1:2:7
fwrite(fid,aray(1,ii),'ubit8');
fwrite(fid,aray(1,ii+1),'ubit4');
end
fclose('all');
and for reading :

fid=fopen('data.txt','r');
for ii=1:2:7
A(ii)=fwrite(fid,1,'ubit8');
A(ii+1)=fwrite(fid,1,'ubit4');
end
fclose('all');
but i havn't a correct results
please can you help me :)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top