You are on page 1of 3

MAT1011 Calculus for Engineers

Fall Semester 2019-20


MATLAB Digital Assignment
Exeriment-1:
Q1. Code:
syms x
f= x^3 + 3*x^2 + 2
subs(f,2)
subs(f,10)
ezplot(f)

x = linspace(-10,10, 25)
f = x.^3 + 3*x.^2 + 2
plot (x, f, ‘linwidth’, 2)
xlabel(‘X-axis’)
ylabel(‘Y-axis’)
title(‘Function f’)

ANUKRITI VERMA | REG. NO.: 19BCB0019


MAT1011 Calculus for Engineers

Q2. Code:
syms x y y1
x=linspace(-3*pi, 3*pi, 100)
y= sin(x)
y1= cos(x)
plot(x, y, x, y1, ‘linewidth’, 2)
xlabel(‘X-axis’)
ylabel(‘Y-axis’)
title(‘Function sin(x), cos(x)’)
legend(‘sin(x)’,‘cos(x)’)

ANUKRITI VERMA | REG. NO.: 19BCB0019


MAT1011 Calculus for Engineers

ANUKRITI VERMA | REG. NO.: 19BCB0019

You might also like