Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

NAMA : FERRIL ANDREAN

NIM : 180102023

MATKUL : PEMOGRAMAN KOMPUTER

PRODI : TEKNIK MESIN

CONTURE :
[x,y] = meshgrid(-5:0.1:5,-3:0.1:3); %independent variables
g = x.^2 + y.^2; % our function
[C, h] = contour(x,y,g); % call the contour function
set(h,'ShowText','on','TextStep',get(h,'LevelStep')*1)
print -deps graph.eps

[x,y] = meshgrid(-5:0.2:5,-3:0.2:3); %independent variables


g = x.^2 + y.^3; % our function
contour(x,y,g) % call the contour function
print -deps graph.eps
[x,y] = meshgrid(-5:0.1:5,-3:0.1:3); %independent variables
g = x.^2 + y.^2; % our function
contour(x,y,g) % call the contour function
print -deps graph.eps

[x,y] = meshgrid(-5:0.1:5,-3:0.1:3); %independent variables


g = x.^3 + y.^3; % our function
[C, h] = contour(x,y,g); % call the contour function
set(h,'ShowText','on','TextStep',get(h,'LevelStep')*2)
print -deps graph.eps

[x,y] = meshgrid(-5:0.1:5,-3:0.1:3); %independent variables


g = 0.5*x.^2 + 2*y.^2; % our function
[C, h] = contour(x,y,g); % call the contour function
set(h,'ShowText','on','TextStep',get(h,'LevelStep')*2)
print -deps graph.eps
THREE DIMENSION :
[x,y] = meshgrid(-2:.2:2);
g = x .* exp(-x.^2 - y.^2);
plot3(x, y, g)

syms x
y = 2*x^3 + 3*x^2 - 12*x + 17; % defining the function
ezplot(y)
[x,y] = meshgrid(-2:.2:2);
g = 2*x .* exp(-x.^2 - y.^2);
surf(x, y, g)
print -deps graph.eps

f = (x - 3)/abs(x-3);
ezplot(f,[-1,5])
l = limit(f,x,3,'left')
r = limit(f,x,3,'right')

[x,y] = meshgrid(-2:.2:2);
g = x^2 .* exp(-x.^2 - y.^2);
surf(x, y, g)
print -deps graph.eps
syms x
y = 2*x^3 + 3*x^2 - 12*x + 17; % defining the function
ezplot(y)

PLOTTING :
x = [12345678910];
x = [-100:20:100];
y = x.^2;
plot(x,y)
x = [12345678910];
x = [-100:5:100];
y = x.^2;
plot(x,y)

x = [0:0.01:10];
y = sin(x);
plot(x,y), xlabel('x'), ylabel('sin(x)'), title('sin(x) Graph'),
grid on, axis equal
x = [0:0.01:10];
y = cos(x);
plot(x,y), xlabel('x'), ylabel('cos(x)'), title('cos(x) Graph'),
grid on, axis equal

x = [0:0.01:10];
y = tan(x);
plot(x,y), xlabel('x'), ylabel('tan(x)'), title('tan(x) Graph'),
grid on, axis equal
x = [0:0.01:10];
y = sin(x);
g = cos(x);
plot(x, y, x, g,'.-'), legend('sin(x)', 'cos(x)')

x = [4:0.02:10];
y = sin(x);
g = cos(x);
plot(x, y, x, g,'.-'), legend('sin(x)', 'cos(x)')

You might also like