Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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')

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Performance Engineering 10th European Workshop Epew 2013 Venice Italy September 17 2013 Proceedings

Authors: Maria Simonetta Balsamo ,William Knottenbelt ,Andrea Marin

2013 Edition

3642407242, 978-3642407246

More Books

Students also viewed these Programming questions

Question

Are external chills as effective as internal chills? Explain.

Answered: 1 week ago

Question

???? understand how to evaluate secondary data;

Answered: 1 week ago

Question

Identify the major areas that are regulated.

Answered: 1 week ago