How to replace certain numbers in an array
Show older comments
Could anybody help me solve the problem please? I have a sample array a=[6 8 7 4 12 10 16 11], I would like to replace all numbers greater than 10(>10) to be 20-a, the expected result should be a=[6 8 7 4 8 10 4 9]. Thank you very much.
Accepted Answer
More Answers (1)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!