Question: In the following code, please note the missing sections labeled ? 1 , ? 2 and ? 3 . function [ final ] = examQuestion

In the following code, please note the missing sections labeled ?1,?2 and ?3.
function [final]= examQuestion (mat)
[m,n,~]= size(mat);
final = uint8(zeros(?1));
for i =?2
if mod(i,2)==1% odd index
for j =1:n
final(i,j,1)= mat ((i+1)/2,j,1);
final(i,j,2)= mat ((i+1)/2,j,2);
final(i,j,3)= mat ((i+1)/2,j,3);
end
?3% even index
for j =1:n
final(i,j,1)= mat (i/2,j,1)/2+ mat (i/2+1,j,1)/2;
final(i,j,2)= mat (i/2,j,2)/2+ mat (i/2+1,j,2)/2;
final(i,j,3)= mat (i/2,j,3)/2+ mat (i/2+1,j,3)/2;
end
end
end
The final image is supposed to be extended along the vertical direction by inserting new row as average of neighboring rows. Which of the following should replace the missing sections?
Group of answer choices
?1 should be (2*m-1,n,3),?2 should be 1:2*m-1,?3 should be else
?1 should be (m,2*n-1,3),?2 should be 1:m,?3 should be end
?1 should be (2*m-1,2*n-1,3),?2 should be 1:2*m-1,?3 should be elseif mod(i,2)==0
?1 should be (2*m-1,n,3),?2 should be 1:m,?3 should be elseif

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!