Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

Please Help! Unable to perform assignment because the left and right sides have a different number of elements. Assignment is to color the inside of the star a random color.

1 view (last 30 days)
img2=imread(''wingding-star.jpg');
subplot(1,2,1);imshow(img2);
red=img2(:,:,1);
green=img2(:,:,2);
blue=img2(:,:,3);
%Task 1A take white pixels and make them into random color
%Generate random number
rng(0,'twister');
a=0;
b=255;
random=(b-a).*rand(1000,1)+a;
%capture all white pixels
wpixels=red==255&green==255&blue==255;
%make white pixels random
red(wpixels)=random;
blue(wpixels)=random;
green(wpixels)=random;
rgbImage=cat(3,red,green,blue);
subplot(1,2,2);imshow(rgbImage);

Answers (0)

This question is closed.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!