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.

how to do the zero padding in the binaray data

Status
Not open for further replies.

Hira Noor

Newbie level 1
Newbie level 1
Joined
Mar 31, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
pakistan
Activity points
1,287
function bindat = text2bin(text)
temp1 = dec2bin(double(text));
temp2 = reshape(temp1,1,[]);
for i = 1:length(temp2)
if temp2(1,i) == '0'
bindat(i) = 0;
else
bindat(i) = 1;
end
end


this is the function file for converting any text into binary... i want to ask that how to do the zero padding in the binaray data , as if we want to set the limit to 100 characters but user enters only 60 characters so the program pads 40 zeros to make them 100..
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top