loops - Value comparison of matrix elements in MATLAB -


say have 256 256 matrix. replace values 'greater' or 'equal' 10 1 , make rest 0 i.e. (values < 10).

for example,

2   3 6 15 24 32 1  7  39 10 ....  1   5 7 11 19 10 20 28 9 ........  10 24 6 29 10 25 32 10 ..........  .................................  ................................. 

and want output be:

0 0 0 1 1 1 0 0 1 1 ............  0 0 0 1 1 1 1 1 0 ..............  1 1 0 1 1 1 1 1 ................  ................................  ................................ 

how can it?

example:

a = [3  2  6  6 ;       7  5  3  7 ;       7 10  8  9 ;       2  4  3 10];  b = ( > 5 ) b =       0     0     1     1      1     0     0     1      1     1     1     1      0     0     0     1 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -