Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Matlab Prob: Replace any values in matrix

Status
Not open for further replies.

naddie

Civil/Environmental
Joined
Jul 25, 2010
Messages
2
Location
AU
Hi all,

I am really new with matlab and would like some helps with matlab.. Here is the problem:

Say if i have a 256 by 256 matrix. I would like to replace any values that are 'greater' or 'equal' to 10 with 'one' and name the rest as 'zero' i.e. (values <10).. How can I do it??

For example, 256 by 256 matrix,

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 I want it to look like the one shown below (256 by 256 matrix),

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 ...............

.....................

....................

Thank you so much in advance with all your time... :)


 
Is this for school?

TTFN

FAQ731-376
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top