Draw an image of the American Flag that is 1000 pixels wide and650 pixels tall! There should
No answer yet for this question.
Ask a Tutor
Question:
Draw an image of the American Flag that is 1000 pixels wide and650 pixels tall! There should be 7 red and 6 white horizontalstrips each with a height of 50 pixels (red is first!). The topleft corner should be a solid blue box that is 400 pixels wide and350 pixels tall (do not draw the stars).
----My code is supposed to display the American flag in MATLAB,BUT IS NOT DOING SO...PLEASE HELP ME TY
clc; clear;
B=650;
C=1000;
A=zeros(B,C,3);
for i=1:B
for j=1:C
if i<=350 && j<=400
A(i,j,3)=255;
else
if rem(i,100)>=1&& rem(i,100)<=50
A(i,j,1)=255;
else
A(i,j,:)=[255;255;255];
end
end
end
end
imwrite(A,'Generated Image.jpg')
Posted Date: