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: Random match count
Replies: 1   Last Post: Jul 21, 2012 7:01 AM

Advanced Search

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

Posts: 1
Registered: 7/20/12
Random match count
Posted: Jul 20, 2012 1:52 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Need a code for if we give input as 01001011 and system should generate unique random combinations of 0 and 1 of 8 digit and should match each with input and should display message after match.
I have tried this code
for i=1:2^8

x=strrep(num2str(rand(1,8)>0.5),' ','')

if(x=='01001011')

disp('success');
else
disp('no');
end
end

but no having unique combinations generated.


Date Subject Author
7/20/12
Read Random match count
Engg
7/21/12
Read Re: Random match count
ImageAnalyst

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

[Privacy Policy] [Terms of Use]

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