How can I write a program to investigate whether a number belongs to matrix?
조회 수: 8(최근 30일)
I have a Matrix named A and a number like B=11. I want to write a program which gives C=1 when B belongs to A and C=0 when B doesn't belong to A. I'm really interested in Matlab special features instead of long codes in my program.
A=[1 2 3 5 21 2 4 0 11 3]
if B=11 then C=1
if B=9 then C=0