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 num2str size not working help

Status
Not open for further replies.

ghattasak

Member level 1
Member level 1
Joined
Dec 31, 2012
Messages
33
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,595
having an array of 32*32 when using num2str i get a char array of 32*94 why? i cannot use bin2dec on it

data = uint32(randi(2^31,[32,1]));
m = de2bi((data),32);
groups = num2str(m');

the array groups will be of type char 32*94
i cannot convert it to decimal :S

- - - Updated - - -

data = uint32(randi(2^31,[32,1]));
m = de2bi((data),32);
groups = (m');
power2=[1,32];

for i=1:32
power2(i)=2^(i-1);
end

power2=uint32(power2);
decnum=[1,32];

for i=1:32
decnum(i)=(sum(power2.*groups(i,:)));
end

decnum=uint32(decnum);


this is the updated code but it is somekind of slow if i want to do it on 500 000number
any suggestions plz?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top