Вы находитесь на странице: 1из 7

II.

x=[-1:0.1:1];

>> f=x.^2;

>> g=x.^3;

>> figure (1)

>> plot(x,f,'r:*')

>> xlabel('X')

>> ylabel('Y')

>> title('Graficul functiei f(x)')

>> legend('f(x)')

>> figure (2)

>> plot (x,g,'b-^')

>> xlabel('X')

>> ylabel('Y')

>> title('Graficul functiei g(x)')

>> legend('g(x)')

Graficul functiei g(x)


Graficul functiei f(x) 1
1 g(x)
f(x) 0.8
0.9
0.6
0.8
0.4
0.7
0.2
0.6
0
Y

0.5
Y

-0.2
0.4

0.3 -0.4

0.2 -0.6

0.1 -0.8

0 -1
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
X X

II. b

figure(3)

>> hold on

>> plot(x,f,'r:*')

>> plot (x,g,'b-^')


>> xlabel('X')

>> ylabel('Y')

>> title('Graficul functiei f(x) si g(x)')

>> legend('f(x)','g(x)')

II. c

subplot(3,1,1)

>> plot(x,f,'r:*')

>> xlabel('X')

>> ylabel('Y')

>> title('Graficul functiei f(x)')

>> legend('f(x)')

>> subplot(3,1,2)

>> plot (x,g,'b-^')

>> xlabel('X')

>> ylabel('Y')

>> title('Graficul functiei g(x)')

>> legend('g(x)')

>> subplot(3,1,3)

>> hold on

>> plot(x,f,'r:*')

>> plot (x,g,'b-^')

>> xlabel('X')

>> ylabel('Y')

>> title('Graficul functiei f(x) si g(x)')

>> legend('f(x)','g(x)')
Graficul functiei f(x)
1
f(x)

0.5
Y

0
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
X
Graficul functiei g(x)
1
g(x)

0
Y

-1
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
X
Graficul functiei f(x) si g(x)
1
f(x)
g(x)
0
Y

-1
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
X

>> subplot(1,3,1)

>> plot(x,f,'r:*')

>> xlabel('X')

>> ylabel('Y')

>> title('Graficul functiei f(x)')

>> legend('f(x)')

>> subplot(1,3,2)

>> plot (x,g,'b-^')

>> xlabel('X')

>> ylabel('Y')

>> title('Graficul functiei g(x)')

legend('g(x)')

>> subplot(1,3,3)

>> hold on
>> plot(x,f,'r:*')

>> plot (x,g,'b-^')

>> xlabel('X')

>> ylabel('Y')

>> title('Graficul functiei f(x) si g(x)')

>> legend('f(x)','g(x)')

Graficul functiei f(x) Graficul functiei g(x) Graficul functiei f(x) si g(x)
1 1 1
f(x) g(x) f(x)
0.9 0.8 0.8 g(x)

0.8 0.6 0.6

0.7 0.4 0.4

0.6 0.2 0.2

0.5 0 0
Y

0.4 -0.2 -0.2

0.3 -0.4 -0.4

0.2 -0.6 -0.6

0.1 -0.8 -0.8

0 -1 -1
-1 0 1 -1 0 1 -1 0 1
X X X

II. c 2

subplot(2,2,1)

>> plot(x,f,'r:*')

xlabel('X')

ylabel('Y')

title('Graficul functiei f(x)')

legend('f(x)')

>> subplot(2,2,3)
>> plot (x,g,'b-^')

xlabel('X')

ylabel('Y')

title('Graficul functiei g(x)')

legend('g(x)')

>> subplot(1,2,2)

>> hold on

plot(x,f,'r:*')

plot (x,g,'b-^')

xlabel('X')

ylabel('Y')

title('Graficul functiei f(x) si g(x)')

legend('f(x)','g(x)')

Graficul functiei f(x) Graficul functiei f(x) si g(x)


1 1
f(x) f(x)
0.8 g(x)

0.5 0.6
Y

0.4

0 0.2
-1 -0.5 0 0.5 1
X 0
Y

Graficul functiei g(x)


1
-0.2
g(x)
0.5 -0.4

0
Y

-0.6

-0.5 -0.8

-1 -1
-1 -0.5 0 0.5 1 -1 -0.5 0 0.5 1
X X
subplot(2,2,1)

>> hold on

plot(x,f,'r:*')

plot (x,g,'b-^')

xlabel('X')

ylabel('Y')

title('Graficul functiei f(x) si g(x)')

legend('f(x)','g(x)')

>> subplot(2,1,1)

>> hold on

plot(x,f,'r:*')

plot (x,g,'b-^')

xlabel('X')

ylabel('Y')

title('Graficul functiei f(x) si g(x)')

legend('f(x)','g(x)')

>> subplot(2,2,3)

>> plot(x,f,'r:*')

xlabel('X')

ylabel('Y')

title('Graficul functiei f(x)')

legend('f(x)')

>> subplot(2,2,4)

>> plot (x,g,'b-^')

xlabel('X')

ylabel('Y')

title('Graficul functiei g(x)')

legend('g(x)')
Graficul functiei f(x) si g(x)
1
f(x)
g(x)
0.5

0
Y

-0.5

-1
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
X
Graficul functiei f(x) Graficul functiei g(x)
1 1
f(x) g(x)
0.5

0.5 0
Y

-0.5

0 -1
-1 -0.5 0 0.5 1 -1 -0.5 0 0.5 1
X X

Вам также может понравиться