Question

In: Advanced Math

write a MATLAB script that plots the two functions ( y=(2x^2)-(3x)-4 and y=4sin(2Pix) - 1 )...

write a MATLAB script that plots the two functions ( y=(2x^2)-(3x)-4 and y=4sin(2Pix) - 1 ) in the same figure for x in [-1,3]. Add a title, x-label, y-label, and legend. ( MATLAB code and graph with all descriptions.)

Solutions

Expert Solution

MATLAB Code:

close all
clear
clc

x = linspace(-1,3,100);
y1 = 2*x.^2 - 3*x - 4;
y2 = 4*sin(2*pi*x) - 1;
plot(x,y1,x,y2)
title('y = 2x^2 - 3x - 4 and y = 4sin(2\pix) - 1')
xlabel('x'), ylabel('y')
legend('y = 2x^2 - 3x - 4', 'y = 4sin(2\pix) - 1')

Plot:


Related Solutions

y'=y-x^2 ; y(1)= -4 Write a MATLAB program that makes two plots of the solution to...
y'=y-x^2 ; y(1)= -4 Write a MATLAB program that makes two plots of the solution to the equation using the following values. Suggest you use nested loops instead of two different loops. Be sure to label your plots. a. x0 = 1.0, step size h = .2, number of steps n = 20. b. x0 = 1.0, step size h = .05, number of steps n = 80.
Solve for x x^4 + 2x^3 + 2x^2 + 3x + 1 = 0
Solve for x x^4 + 2x^3 + 2x^2 + 3x + 1 = 0
Given two planes 3x − 2y + z = 1 and 2x + y − 3z...
Given two planes 3x − 2y + z = 1 and 2x + y − 3z = 3. (a). Find the equation for the line that is the intersection of the two planes. (b). Find the equation for the plane that is perpendicular to the two planes.
Find the derivatives of each of the following functions: 1. f(x) = (3x^2 + 2x −...
Find the derivatives of each of the following functions: 1. f(x) = (3x^2 + 2x − 7)^5 (2x + 1)^8 2. g(t) = cos(e^2x2+8x−3) 3. h(x) = e^x2/tan(2x−3) 4. Find dy/dx if cos(xy) = x^2y^5
1)In a tow dimensional plane draw a graph of y=3x-1 and y=2x^2. 2)Find the roots of...
1)In a tow dimensional plane draw a graph of y=3x-1 and y=2x^2. 2)Find the roots of the equation 2x^2 -3x+1=0 3)If function f(x)=2x^2-3x+1, what the value of x where f(x) reaches its minimum?
Write script in Matlab to solve 1. Y=Ax where X is of dimension n by 1...
Write script in Matlab to solve 1. Y=Ax where X is of dimension n by 1 and A is of dimension m by n. 2. C= A*B where A is of dimension m by p and B is dimension of p by n. So write matlab script to obtain Y and C in above problems.
Given two planes 3x − 2y + z = 1 and 2x + y − 3z = 3.
Given two planes 3x − 2y + z = 1 and 2x + y − 3z = 3. (a). Find the equation for the line that is the intersection of the two planes. (b). Find the equation for the plane that is perpendicular to the two planes.  
Solve ODE (3x - 2y + 1)dx + (-2x + y + 2)dy = 0 with...
Solve ODE (3x - 2y + 1)dx + (-2x + y + 2)dy = 0 with the method of x =u + h and y = v + k
  Solve a.      x + y = 3, 2x – y = 1 b.      3x + 2y = 6,...
  Solve a.      x + y = 3, 2x – y = 1 b.      3x + 2y = 6, x = 3 c.      2x + y = 4, y = -2x + 1 d.      x – 3y = 6, 2x – y =1
Let Q1=y(2) Q2 =y(3) where y=y(x) solves y'+2xy=2x^3     y(0)=1 dy/dx= (2x-y)/(x+4y)     y(1)=1 y'+ycotx=y^3sin^3x      y(pi/2)=1 (y^2-2x)dx+2xy dy=0   ...
Let Q1=y(2) Q2 =y(3) where y=y(x) solves y'+2xy=2x^3     y(0)=1 dy/dx= (2x-y)/(x+4y)     y(1)=1 y'+ycotx=y^3sin^3x      y(pi/2)=1 (y^2-2x)dx+2xy dy=0    y(1)=1 2x^2y;+4xy=3sinx    y(2pi)=0 y"+2y^-1 (y')^2=y'
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT