Question

In: Computer Science

Write a function file that accepts each of the four vectors as inputs. The function file...

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

Solutions

Expert Solution

`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.


Related Solutions

Write a MATLAB function named myaccel that accepts three inputs and has a single output. Inputs:...
Write a MATLAB function named myaccel that accepts three inputs and has a single output. Inputs: a list of time values a list of position values a single time value. Output: a single number which is obtained by numerically differentiating position with respect to time twice (forward difference method) and then interpolating the results based on the third input. Example: time=0:10; position=time.^3; myaccel(time,position,2.8) % should return 22.8
Write a Matlab/SciLab function that accepts inputs as degrees and computes the equivalent within the interval...
Write a Matlab/SciLab function that accepts inputs as degrees and computes the equivalent within the interval 0 to 360. function de=equivalent(d) For example, equivalent(540) = 180 equivalent(-30) = 330
On Python Write a function that accepts a relative file path as parameter and returns number...
On Python Write a function that accepts a relative file path as parameter and returns number of non-empty lines in the file. Test your function with the provided sample file studentdata.txt.
Write a program that accepts the lengths of three sides of a triangle as inputs. The...
Write a program that accepts the lengths of three sides of a triangle as inputs. The program output should indicate whether or not the triangle is a right triangle. Recall from the Pythagorean theorem that in a right triangle, the square of one side equals the sum of the squares of the other two sides. Use The triangle is a right triangle. and The triangle is not a right triangle. as your final outputs. An example of the program input...
USING JAVASCRIPT Create a file name dayOfWeek.js and write an arrow function named dayOfWeek that accepts...
USING JAVASCRIPT Create a file name dayOfWeek.js and write an arrow function named dayOfWeek that accepts a Date object dateStr and returns a string that is the day of the week in English form (i.e. “Sunday”, “Monday”, etc.). Test your function by creating a date object that is a significant date to you (such as your birthday) and passing that date object to your function. Test your function at least twice with two different dates. Submit the dayOfWeek.js file to...
write a function mean_value that accepts up to four integers and returns their possibly floating point...
write a function mean_value that accepts up to four integers and returns their possibly floating point mean_value. the function should be able to work with any number of inputs from one to four. ( it just returns the input if there is only one)
C Programming: Write a program that accepts 2 arguments, an input file and an output file....
C Programming: Write a program that accepts 2 arguments, an input file and an output file. The program is to store in the output file the contents of the input file in reverse. If the input file looks like this: Hello World.\n This is Line 2\n This is the end.\n then the output file should look like this: \n .dne eht si sihT\n 2 eniL si sihT\n .dlroW olleH The main program should look like this: int main(int argc, char...
Write a Huffman decoder in verilog that inputs a text file with testbench.
Write a Huffman decoder in verilog that inputs a text file with testbench.
Write a python function to fulfill the requirements. The function accepts a string, a current state,...
Write a python function to fulfill the requirements. The function accepts a string, a current state, edges’ information, and an accepting state. The output of the function is a boolean value verifying if the string can pass the finite state machine or not.             ### Finite State Machine Simulator in Python ### Provide s1 and s2 that are both accepted, but s1 != s2. s1 = "bdf" s2 = "bdgbdf" edges = {(1,'a') : 2,                (1,'b') : 3,       ...
Write a function in JAVASCRIPT that accepts an array as argument. The function should loop through...
Write a function in JAVASCRIPT that accepts an array as argument. The function should loop through the array elements and accumulate the sum of ASCII value of each character in element and return the total. For example: function([‘A’, ‘bc’, 12]); // returns 361 which is the sum of 65 + 98 + 99 + 49 + 50 Use of any built in string functions or built in array functions is not allowed, Any help would be much appreciated
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT