Thread Subject:
Random match count

Subject: Random match count

From: Engg

Date: 20 Jul, 2012 17:52:06

Message: 1 of 2

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.

Subject: Random match count

From: ImageAnalyst

Date: 21 Jul, 2012 11:01:06

Message: 2 of 2

"Unique" and "random" mean different things. Which is it?

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us