51 Your function called MatrixToVectorm must take an image f
5.1 Your function called \"MatrixToVector.m\" must take an image file name in text string. It will returns a vector. 5.2 The vector returned by function \"MatrixToVector.m\" must be generated by changing the matrix (with image data) into either a row or a column vector, using the scanning pattern shown in Figure 1 5.3 Plot the returned vector.
Solution
The parameter to the function matrixtovector x is an image.
imread is used to read RGB pixel matrices into img_vector.
size(vector,1) gives no of rows in and stores in \"rows\"
Using for loop we access all rows and columns of the 3 matrices(i.e 2:2:rows)
In the loop for every row ,the fliplr function is used to stores the flipped version of row or column as hown in image in a continuous vector .
Finally the vector is shown and stored as new image.jpg
