Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

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 Ansicht (letzte 30 Tage)
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);

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by