what is the command to plot line y=x in matlab between x=-5 to x=5
Hi,
The answer to the question is
x=-5:0.01:5;
plot(x,x);
xlabel('x');
ylabell('y');
Hey,
Note: Brother in case of any queries, just comment in box I would
be very happy to assist all your queries
x=linspace(-5,5);
y=x;
plot(x,y);
Kindly revert for any queries
Thanks.
what is the command to plot line y=x in matlab between x=-5 to x=5
Is the syntax correct (T/F). Suppose x and y are vector. Then plot command is plot(x|y); MATLAB
(a) The MATLAB command trapz(x,y) computes the integral of the function y with respect to the 'variable of integration' r, i.e J ydr. Use MATLAB help to understand how trapz works. (b) Consider r(t) 1 for -1 t1, and r(t) 0 otherwise. Use the trapz command to compute and plot the Fourier transform of r (t). Denote this by X (jw). compute and plot the inverse Fourier transform of 2πX(jw). in part b)? Why, or why not? This is called...
Please show the code necessary, and explanations on MATLAB.
Plotting 11) Plot the function y = sin(x) from x = 0 to 21. 12) Plot the functions y = x2 z = x2 + 2x + 1 from x = 0 to 2 on the same graph. Scripts: Input and Output 13) Write a script (M-file) to read in a message at the command line using the MATLAB input function and then display the message to the Command Window using...
matlab
Problem 6: The Matlab command 'randn(m,n) produces an m x n matrix of random numbers that are a realization of a white random process with some probability density function. Moreover, the Matlab command 'rand(m,n)' produces an mxn matrix of random numbers between 0 and 1 that are a realization of a white random process with some probability density function. a) Use Matlab to do the following steps: 1) Let u-randn (10000,1); and plot u. 2) Use the command 'mean(u)'...
(MATLAB Question) I'm trying to create an equation of a line (y=mx+b) based on “x” with slope m=2 and y-intercept 2. (y=2x+2). Then plot the line and turn hold on. This is what I have so far, I know something is wrong, but I am not sure at what part. Y=mx+b; Y=2x+2; m=2; y-intercept=2; (plot(x,y)) (plot hold on)
Plot f(x) = x^3 - y using MATLAB. Include zero crossings in the plot.
Please solve it in MATLAB
6) Interpolation and plot: y=x*; x=0:5; a) Interpolate: x1= 1.5; x2=2.5; x3=3.5 b) Plot x and y and label axis. 7)- A= [1,2;3,4); B= [5,6;7,8] Using MATLAB find the following: A+B; A-B; AB, A/B, A-1,B-1, A.B, A./B 8). Using MATLAB: F(x) = y=x+- 2x2 + 3x – 4 a) find the roots of the polynomial f(x) b) find the integral of the polynomial f(x) c) find the SS(x)dx.
In MATLAB please
Consider the nonlinear function: y = f(x) = x3 cos x a. Plot y as a function of x as x is varied between -67 and 67. In this plot mark all the locations of x where y = 0. Make sure to get all the roots in this range. You may need to zoom in to some areas of the plot. These locations are some of the roots of the above equation. b. Use the fzero...
For MATLAB
3. write a program to plot a scatter plot of data (x, y) pairs and compute the correlation coefficient. Data and details are provided below. In Lecture 9 it was noted that the numerator used in the sample variance could be obtained using the sum(x) and sum(x. 'x) functions: iz1 The average is sum(x)/n. If an array y of the same length is computed in the same way call that term Syy. The term Sxy can be computed...