How to use logical indexing to change certain values in matrix

15 views (last 30 days)
I am trying to use logical indexing to change all elements=112 in a matrix into 225. How do I write a code for this. Any help hugely appreciated thanks in advance

Answers (1)

dpb
dpb on 25 Nov 2015
x(x==112)=225;

Community Treasure Hunt

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

Start Hunting!