Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

please help with Matlab Problem 6: (4 pts) You are using the Draw Square functio

ID: 3665010 • Letter: P

Question


please help with Matlab

Problem 6: (4 pts) You are using the Draw Square function funetion 11 -DEaN Square (center location, edge length, rgb) Write a short Matiab program which will produce the following pattern. The rgb code for the black color is [oo O) and for white it is (1 11]. The outer white square has side 8. The small black squares have side 1. The program has the start shown; continue writing Matlab to finish the program. (Hint: Eor looping will be needed.) clear vatiables close al Draw Square LI4,41,8,11 1 1 hold on

Explanation / Answer

need Draw_Square function if you want to see the output

clear i j;
close all;
% outer square
Draw_Square([4 4],8,[1 1 1]);
hold on;

%inner squares
for i = 1.5:2:7.5
for j = 1.5:2:7.5
Draw_Square([i j],1,[0 0 0]);
end
end