Part 3: Loop design (8 points) Fill in the appropriate vector for each for loop
ID: 3737431 • Letter: P
Question
Part 3: Loop design (8 points) Fill in the appropriate vector for each for loop or conditional for each while loop to complete each task. Use functions wherever possible and DO NOT hard code in values unless necessary, ie. do not type in for 1:10 if you are iterating over a vector with 10 values, instead type in for i- 1:1ength (vector). Write your answers in the table on the last page in the corresponding location. d type in for i = 1 : length (vector). write your answers in the % for loop that iterates through eve ry element in vector vector = randi (100, 1,200); 1 for perform task end 2 3 for loop that iterates over every other column in i EAS 230-Spring 2018-Lab 6- Page 2 NAME: PERSON #: LAB SECTION img zeros (100): for perform task endExplanation / Answer
Answers are given below. Only the code that fills the blank is given
1. for i = 1:length(vector)
2. for i = 1:size(img, 2)
3. while length(in) ~= 5
4. while difference >= 1