Question

Exercise 4: Use randi(5,[88]) to generate an 8x8 matrix, write Matlab script to do the following;

(1) Input any valid row and column number, retune the element value;

(2) Display all 4-adjacent neighbors of the element;

(3) Display row and column of any 4-adjacent neighbor of the element which has the

same intensity as the element. If no element has the same value, display "none”;

(4) Display all 8-adjacent neighbors of the element;

(5) Display row and column of any 8-adjacent neighbor of the element which has the

same intensity as the element. If no element has the same value, display "none".

Question image 1