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

Solve Using MatLAB: Function Name: asciiResize Inputs: (char) An M x N array of

ID: 3420220 • Letter: S

Question

Solve Using MatLAB:

Function Name: asciiResize

Inputs:

(char) An M x N array of characters

(double) A positive value greater than or equal to 1 specifying the scale factor

Outputs:

1. (char) The resized character array of the input

Function Description:

Write a MATLAB function called asciiResize() that takes in an MxN array of such ASCII art, and resizes it by the given scale factor. So if the input array was MxN and the scale factor was 3, the resulting array would be 3M x 3N.

Notes:

The same scale factor is applied to the horizontal and vertical dimensions.

If the scale factor is not an integer, you should round the third input of linspace() to

obtain the number of new rows and columns.

Included in the test cases are ‘.mat’ files. Typing load(‘<file_name>.mat’) into

the Command Window, or double-clicking the ‘.mat’ file in the Current Directory, will

load any variables saved in the file to the Workspace.

Included ASCII art creation courtesy of the internet.

Hints:

Consider editing the vecResize() function (from Homework 04) and using it as a helper function to find the needed resized indices in a given dimension (rows versus columns).

Explanation / Answer

I=imread("image");

figure;

imshow(I);

A=rgb2gray(I);

figure,

imshow(A);

B=imresize(A,[60,120]);

s='#n*:.';

C=gray2ind(B,length(s));

S(C+1)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote