23MAT107 Calculus Lab3
23MAT107 Calculus Lab3
23MAT107 - Calculus
Lab Practice Sheet-3
(OR)
syms f(x)
f(x) = x^2;
figure
fplot(f(x), [-5 5], 'Color','yellow')
grid on; hold on
fplot(f(x)+4, [-5 5],'Color','red')
hold on
fplot(f(x)-4, [-5 5],'Color','green')
hold on
fplot(f(x-1), [-5 5],'Color','purple')
hold on
fplot(f(x+2)+4, [-5 5],'Color','blue')
hold on
fplot(f(x-3)-5, [-5 5],'Color','black’)
hold on
fplot(-f(x), [-5 5],'Color','magenta')
hold off
axis equal; axis([-8 8 -8 8])
xlabel('x'); ylabel('y')
title('Shifting of graph')
➢ Scaling of functions
x=0:0.01:10; plot(x,sqrt(x),'Color','yellow')
grid on
hold on
t=-10:0.01:0; plot(t,sqrt(-t),'Color','red')
hold on
y2=-sqrt(x); plot(x,y2,'Color','green')
hold on
y3=3*sqrt(x); plot(x,y3,'Color','blue')
hold on
y4=(1/3)*sqrt(x); plot(x,y4,'Color','black')
hold on
y5=sqrt(x/3); plot(x,y5,'Color','magenta')
hold on
y6=sqrt(3*x); plot(x,y6,'Color','cyan')
axis([-8 8 -8 8])
hold off
1. Vertical Scale
syms f(x)
f(x) = x^2;
figure
fplot(f(x), [-4 4], 'Color','yellow')
grid on; hold on
fplot(2*f(x), [-4 4], 'Color','blue')
hold on
fplot((1/2)*f(x), [-4 4], 'Color','magenta')
hold off
axis equal; axis([-6 6 0 5])
xlabel('x'); ylabel('y')
title('Vertical Scale')
2. Horizontal Scale
syms f(x)
f(x) = x^2;
figure
fplot(f(x), [-4 4], 'Color','yellow')
grid on; hold on
fplot(f(2*x), [-4 4], 'Color','red')
hold on
fplot(f((1/2)*x), [-4 4], 'Color','green')
hold off
axis equal; axis([-6 6 0 5])
xlabel('x'); ylabel('y')
title('Horizontal Scale')