Clear Filters
Clear Filters

how can i use 'If' statement for this 00000,1000​0,11000,11​100,11110,​11111 six 5bit values using 'OR' logical operator inside IF satement ?

2 views (last 30 days)
sir, I am doing project on palm print and finger print authentication using neural network.I have image of palm and finger of the same person.I am taking LLF subband of both images and doing fusion.After fusion I have divided that fused image into matrix of 5*5 block and then calculating the standard deviation of each block.So,I got the 25 standard deviation values for each image and i m using that values as an input to neural network.I have trained the neural network for 6 person with 5 images of each person."00000,10000,11000,11100,11110,11111" this 6 values are identity of each person.As mentioned in question i want to play an audio file which saying access granted and access denied n for that i need if statement using logical 'OR' operator but it shows me this error.
"??? Operands to the || and && operators must be convertible to logical scalar values.
Error in ==> linked at 194 if(O1==00000||10000||11000)" so please tell me the solution how can i do this?

Accepted Answer

Mischa Kim
Mischa Kim on 3 Mar 2014
Edited: Mischa Kim on 3 Mar 2014
Use
if (strcmp(O1,'00000') || strcmp(O1,'10000') || strcmp(O1,'11000'))
The three conditions need to be evaluated separately. Also, binary numbers are stored as a string of chars.
  1 Comment
Ashok
Ashok on 3 Mar 2014
Thank you for your support. But still it showing error while playing .wav file.I m attaching my code with it. Please check the last 5 to 6 lines n tell me how can i get the correct answer??

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!