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

Instructions: 1.) Write a script (.m file) that creates a matrix filled with zer

ID: 3566157 • Letter: I

Question

Instructions:

1.) Write a script (.m file) that creates a matrix filled with zeros or ones.

2.) Your matrix must be a minimum size of 30 x 60. There needs to be twice as many columns as rows so that the matrix appears square.

3.) Manipulate this matrix using MATLAB commands and loops to create an image or pattern in the matrix. If your initial matrix is zeroes, add ones; and if your initial matrix is ones, add zeros.

4.) Your shape cannot be a simple square or a plus sign. It must involve at least four different "lines" or pieces that create the picture.

Explanation / Answer

A= randi([0, 1 ] , 300 , 600 )
i=1;
j=1;
while i<301
j=1;
while j<601
A(i,j)=~(A(i,j));
j=j+1;
end
i=i+1;
end
imshow(A)