In: Advanced Math
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.)
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: