How can I default an array to show either 0's or 1's?
Show older comments
I have an array that is defined by:
pict(i, j) = pict(i, j) + (sum1^2 - sum2)/32;
The array is a 41 x 41 double, and yields the result:

I'm plotting this figure using:
image(Rx, (Ry-40), pict, 'CDataMapping', 'scaled')
The area (in yellow) at -11 on the y-axis is my maximum point in the image. Is there a way for me to manipulate my array to make a range of maximum values 1 and everything else 0?
Accepted Answer
More Answers (1)
Steven Lord
on 4 Mar 2019
0 votes
If you're using release R2018a or later use the normalize function to normalize your data.
Categories
Find more on Creating and Concatenating Matrices 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!