In: Computer Science
Write a function file that accepts each of the four vectors as inputs. The function file should plot the data on different graphs in the same window. You need to add axis labels and graph titles.
time- 0 5 10 15 20 25 30
A1- 0 7 11 19 15 14 7
A2- 0 10 15 21 16 11 13
A3- 0 9 13 17 22 25 21
`Hey,
Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
clc
clear all
close all
format long
time=[0 5 10 15 20 25 30];
A1=[0 7 11 19 15 14 7];
A2=[0 10 15 21 16 11 13];
A3=[0 9 13 17 22 25 21];
plotVectors(time,A1,A2,A3);
function plotVectors(time,A1,A2,A3)
subplot(3,1,1)
plot(time,A1);
xlabel('Time');
ylabel('Value of vector number 1');
title('Plot of vector number 1');
subplot(3,1,2)
plot(time,A2);
xlabel('Time');
ylabel('Value of vector number 2');
title('Plot of vector number 2');
subplot(3,1,3)
plot(time,A3);
xlabel('Time');
ylabel('Value of vector number 3');
title('Plot of vector number 3');
end
Kindly revert for any queries
Thanks.