All pastes #469734 Raw Edit

hw

public text v1 · immutable
·published 2007-05-03 21:37 UTC
rendered paste body
x = -pi : pi/100 : pi;
y1 = sin(x);
y2 = cos(x);
plot( x,y1, 'b', x,y2,'r');
legend('l1', 'l2');



x= - pi:0.01:pi;
y1 = sin(x); y2 = cos(x); y3 = y1+y2; y4 = y1-y2;
subplot(2,2,1); plot(x,y1); xlabel('p=1');
subplot(2,2,2); plot(x,y2); xlabel('p=2');
subplot(2,2,3); plot(x,y3); xlabel('p=3');
subplot(2,2,4); plot(x,y4); xlabel('p=4');




x = 0 : 0.02 : 3*pi;
y = sin(x);
ax = axes( 'units','normalized', 'position', [ 0.1 0.1 0.8 0.5]);
subplot(ax);
plot(x,y,'d');





ezplot('sin(x)',[-pi,pi]);





%t = 0:pi/50:10*pi;
%plot3(sin(t),cos(t),t,':pb');
[X, Y] = meshgrid(-3*pi:pi/10:3*pi);
Z = sin (X) .* sin (Y);
%mesh (Z);
surf (Z);




coord = 0:0.5:8; % x si y vor lua valori intre 0 si 8
[x, y] = meshgrid(coord, coord);
figure(1)
mesh(x, y, 2.^x + 2.^y) % deseneaza f(x,y) ca o suprafata
xlabel('x')
ylabel('y')
zlabel('Functia 2^x + 2^y')
figure(2)
surf(x, y, 2.^x + 2.^y) % deseneaza f(x,y) ca o suprafata si o coloreaza




x = -8:0.5:8;
y = x;
[X Y] = meshgrid(x, y);
r = sqrt(X.^2 + Y.^2) + eps;
Z = sin(r)./r;
surfc(X, Y, Z);
title('sin(r)/r');
surf(X, Y, Z);
view(10,10);
% c = contour(Z);
% clabel(c);






x = -5:0.005:5;
y = (x-3)./(x.*x-5);
plot(x,y,'g');






%x = (-2*pi+0.5):pi/500:(2*pi-0.5);
clear all;

%for i=1:100 
%    x(i) = i/1000000000;
%    xx(i) = x(i)*x(i); % x^2
%end    
x = -0.1:0.001:0.1;
xx = x.*x;
y = 2.*exp(xx) - sin(xx);
plot(x,y);