Está en la página 1de 7

NOMBRE: MARCO ANTONIO BRAVO SANTIVAEZ

PROBLEMA 1

x=1:50;
i=1;

while(i<50)
if(rem(x(i),3)==0||rem(x(i),4)==0||rem(x(i),5)==0)
n(i)=0;
else
n(i)=x(i);
end
disp(n)
i=i+1;
end

PROBLEMA 2
x=-2:0.01:6;
y=(x<-1).*exp(x+1)+((-1<=x) & (x<5)).*(2+cos(pi*x))+(x>5).*(10*(x-5));
plot(x,y, 'LineWidth',2)
grid on;
xlabel('variable x');
ylabel('variable y');
PROBLEMA 3

x=0:0.01:20;
y1=x.^4;
y2=2.^x;
plot(x,y1,'LineWidth',2)
hold on
plot(x,y2,'LineWidth',2)
grid on
xlabel('eje de X')
ylabel('eje de Y')
title('Grafica de Funciones')
i = find(abs(y2-y1) <0.005);
disp('Cantidad de intersecciones:')
disp(length(i))
disp('soluciones:')
disp(x(i))
h=plot(x(i),y1(i),'*');
set(h,'Linewidth',5)

PROBLEMA 4
x=-3*pi:0.1*pi:3*pi;
y=x;
[X,Y]=meshgrid(x,y);
z=sin(X).*sin(Y);
mesh(z);
grid on;
xlabel('variable x');
ylabel('variable y');
title('z=sen(x)sen(y)')

PROBLEMA 5

a=1;
b=1;
c=8;
while(b<=9)
d=a*c+b;
b=b+1;
a=a*10+b;
disp(d)
end;

PROBLEMA 6

n=0;%cantidad de elementos de la suma


sum=0;
while(n<=501)
y=(-1)^n/(2*n+1);
n=n+1;
sum=sum+y;
end
disp(sum)

PROBLEMA 7

t=0:0.001:4;
y=14- 8.*t;
x=25- 16.*t;

d=(x.^2+y.^2).^(0.5);
i = find(abs(d-8)<=0.005);
disp('SE EMPEZARAN A VER DESDE')
disp (7 +floor(60*t(i)/60)+ (rem(60*t(i),60))/100)
disp('DE LA MAANA')
plot(t,d)
hold on
h=plot(t(i),d(i),'*');
set(h,'Linewidth',1)
xlabel('TIEMPO(horas)');
ylabel('DISNTACIA(metros)');
title('DISTANCIA VS TIEMPO')
grid on

También podría gustarte