Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Large arrays in matlab load the image my_image = imread(\'ultrasound-doppler.jpg

ID: 673520 • Letter: L

Question

Large arrays in matlab

load the image

my_image = imread('ultrasound-doppler.jpg');

Note that the image must be in your working directory or this will return an error. The returned variable (my_image) is a 533x800x3 array: 533x800 pixels in the first and second dimensions, represented in three colors - red, green, and blue (RGB) - at the 1, 2, and 3 indices, respectively of the third dimension. Use what we’ve learned in the past about zeroing out elements to zero out all the green and blue pixels in this multidimensional array. Then show this resulting image using the command

image(my_image)

Provide your commands to zero out the two colors and the resulting image.

Explanation / Answer

my_image = imread('ultrasound-doppler.jpg');
my_image(:,:,2)=0; //set green color value to zero
my_image(:,:,3)=0; //set blue color value to zero
image(my_image); //show image without green and blue color