Write a MATLAB function called myPlot that produces no inputs and takes as inputs x-data, y-data, title, x-label and y-l
Posted: Tue Jul 12, 2022 8:10 am
Write a MATLAB function called myPlot that produces no inputsand takes as inputs x-data, y-data, title, x-label and y-label of agraph. The function should plot the data with a grid and place allthe labels appropriately on the graph. The function should check ifthe size if the xdata and the y-data are equal. If they are notequal, the function pads the ending of the shorter vector withzeros, such that they are the same length, and then continues withthe plotting.
Q2: Sample output from using the following code snippets: myPlot([1 2 3], [1 2 3 4], 'Test One', 'Test X Label', 'Test Y Label'); figure; myPlot([1 2 3 4], [1 2 3], 'Test Two', 'Test X Label', 'Test Y Label'); Figure 1 File Edit View Insert Iools Desktop Window Help DE Test Y Label 4 3.5 2 1.5 1 0 0.5 1 Test Title 1.5 Test X Label 2 2.5 3 X Figure 2 File Edit View Insert Iools Desktop Window Help 18 H 3 2.5 Test Y Label ir 0.5 =' 0 1 5 1.5 2 Test Title 2.5 Test X Label 3 3.5 4 X
Q2: Sample output from using the following code snippets: myPlot([1 2 3], [1 2 3 4], 'Test One', 'Test X Label', 'Test Y Label'); figure; myPlot([1 2 3 4], [1 2 3], 'Test Two', 'Test X Label', 'Test Y Label'); Figure 1 File Edit View Insert Iools Desktop Window Help DE Test Y Label 4 3.5 2 1.5 1 0 0.5 1 Test Title 1.5 Test X Label 2 2.5 3 X Figure 2 File Edit View Insert Iools Desktop Window Help 18 H 3 2.5 Test Y Label ir 0.5 =' 0 1 5 1.5 2 Test Title 2.5 Test X Label 3 3.5 4 X