Question
matlab

Complete the code snippet to create an image that is 32 pixels wide and 32 pixels tall with a blue X on a black background. (
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code-

%create black image of 32x32 with 3 color channels
img = zeros(32, 32, 3, 'uint8');

% loop over each row
for i = 1:32
   % set 3rd channel, blue, at required pixels as 255
   img(i, i, 3) = 255;
   img(33-i, i, 3) = 255;
endfor

%show image
imshow(img);

%create black image of 32x32 with 3 color channels img = zeros(32, 32, 3, uint8); 600 vu WN 4 % loop over each row 5 afor i

OUTPUT-

1585640136650_image.png

I hope it helps. For any doubt, feel free to ask in comments, and give upvote if u get the answer.

Add a comment
Know the answer?
Add Answer to:
matlab Complete the code snippet to create an image that is 32 pixels wide and 32...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT