# MATLAB: Turn background to one color

image processingimage segmentation

I have an RGB image and I want to do something similar to a binary image. But instead of black and white colors, I want some objects to be white, while the background of the image should be blue. How can I accomplish this?
I've tried using for loops, but not sure how to do iterate through RGB images properly.

redChannel(binaryImage) = 0;greenChannel(binaryImage) = 0;blueChannel(binaryImage) = 255;rgbImage = cat(3, redChannel, greenChannel, blueChannel);