Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

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 (최근 30일)
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);

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by