You are on page 1of 4

%Taller I

%1
a=[4:2:22]
b=[5:2:23]
%2
x=[1 4 5 0]
y=(x+5)
z=x.^2
y13=y(1,3)
%3
B=[2 -3 4;2 0 5;1 3 -3]
D=(B+2)
h=B+D
m=B*D
C=inv(B)
i=B*C
t=D'
%4
A=[1 6 3 5;0 6 2 3;7 5 3 10]
e=A(2,4)
b1=A(1,:)
d=A(:,1)
%5
I=[zeros(2,3),eye(2);zeros(3,2),eye(3)]
%6
l=(D*B)'
L=B'*D'
%7
a=[2 -1 1;1 1 0;0 1 -3]
b=[3;3;-7]
c=inv(a)*b
%Parte II
%1
%a
clc
clear all
close all
x=(0:1)
f=(x.^5)+(3*x)+5
plot(x,f)
%b
x=(-0.5:0.5)
g=(exp(3*x)+sin(x))
plot(x,g)
%c
t=(0:(4*pi))
x=t-sin(t)
y=t-cos(t)
h=x.*y
plot(t,h)
%d
teta=(0:(2*pi))
p=cos(teta)+sin(teta/4)
plot(teta,p)

%2
syms x;
n=4
P4=diff((x^2-1)^n,n)/(2^n*factorial(n));
P4=simplify(P4)
n=5;
P5=diff((x^2-1)^n,n)/(2^n*factorial(n));
P5=simplify(P5)
color=['b','g','m','r','c'];
syms x;
figure(2)
hold on
for n=(1:5)
y=diff((x^2-1)^n,n)/(2^n*factorial(n));
hs=ezplot(y,[-1,1]);
set(hs,'color',color(n))
end
hold off
grid on
xlabel('x')
ylabel('P_n(x)')
title('Polinomios de Legendre')
%3
t=linspace(0,1);
f=tan(t);
g=cosh(5*t);
h=(exp(2*t))+(5*sin(2*t));
i=t.^2+3*t+4;
subplot(2,2,1);plot(t,f,'m');title('grafica
subplot(2,2,2);plot(t,g,'r');title('grafica
subplot(2,2,3);plot(t,h,'g');title('grafica
subplot(2,2,4);plot(t,i,'b');title('grafica
%4
x=(-1:0.1:1);
y=(-1:0.1:1);
[x,y]=meshgrid(x,y);
z=sqrt((x.^2+y.^2));
surfc(x,y,z)
hold on
%5
x=(-1:0.1:1);
y=(-1:0.1:1);
[x,y]=meshgrid(x,y);
z=-x.^2-y.^2;
surfc(x,y,z)
hold on
%6
hold on
x=linspace(0,1);
m=(4-x.^2);
n=(3*x.^2);
plot(x,m,'r')
plot(x,n,'b')
j=m-n;
int('j',0,1)

tangente');
coseno hiperbolico');
exponencial + seno');
ecuacion cuadratica');

%Parte III
%1
suma=0;
for i=(1:10)
suma=suma+2^i;
end
suma
%2
produc=1;
for j=(1:10)
produc=produc*j/(j+1);
end
produc
%3
x=[ ];
for i=(1:2:9)
x=[x,i^2];
end
x
%4
x=[ ];
for i=(10:-1:1)
x=[x,i^2];
end
x
%5
n=0
while 2^n < 3000
n=n+1;
end
n-1
%6
A=input('Ingrese el valor de A');
B=input('Ingrese el valor de B');
if A==B
disp('A es igual a B');
else
if A<=B
disp('A es menor que B');
else
if A>=B
disp('A es mayor que B');
else
end
end
end
%7
n= input('ingrese un numero el cual le va a sacar el factorial');
Fac=1;
if n<0
disp('ingrese un numero positivo');
else
if n==0

Fac=1
else
for i=2:n
Fac=Fac*1;
end
end
factorial(n)
end
%8
t= input('ingrese el numero el cual cree que sera');
q=round(10*rand+2)

You might also like