Ejercicios En Matlab
A.
>> pol=[1 -6 -12]
pol =
1 -6 -12
>> roots(pol)
ans =
7.5826
-1.5826
Donde se desprende: x1=7.5826 yx2=-1.5826
B.
>> pol=[3 4 10]
pol =
3 4 10
>> roots(pol)
ans =
-0.6667 + 1.6997i
-0.6667 - 1.6997i
Es decir: x1=-0.6667 + 1.6997i y x2=-0.6667 - 1.6997i
2. GRAFIQUELA SIGUIENTE TRAYECTORIA TEMPORAL EN MATLAB:
>> t=0:0.001:12
>> y=exp(-0.7*t).*(cos(3*t)+4*sin(4*t))+6
>> plot(t,y)
¿Es convergente o divergente?
ES CONVERGENTE A LA TRAYECTORIA
3.MINIMIZAR EN MATLAB:
4. HALLAR LAS SIGUIENTES INTEGRALES IMPROPIAS EN MATLAB:
a. >> syms x
>> int(x^(2),0,1)ans =
1/3
b. >> syms t
>> (1/(2*pi)^0.5)*int(exp(-0.5*t^2),-inf,0.85)
ans =7186705221432913/36028797018963968*2^(1/2)*pi^(1/2)+7186705221432913/36028797018963968*2^(1/2)*pi^(1/2)*erf(17/40*2^(1/2))
5. REPRESENTE GRÁFICAMENTE EN MATLAB:
>> x0=[1,1,1];
>> [x,fval]=fminunc(@myfun,x0)Warning: Gradient must be provided for trust-region method;
using line-search method instead.
> In fminunc at 247
Optimization terminated: relative infinity-norm of gradient less thanoptions.TolFun.
x =
1.0e-006 *
0.4212 -0.1979 0.0624
fval =
2.0000
Por condicion de primer orden:
Por lo tanto: x1=0.4212 ; x2=-0.1979 ; x3=0.0624
El valor de z=2
Porcondicion de primer orden:
exitflag =
1
output =
iterations: 10
funcCount: 44
stepsize: 1
firstorderopt: 1.5795e-006
algorithm: 'medium-scale:Quasi-Newton line search'
message: 'Optimization terminated: relative infinity-norm of gradient less than options.TolFun.'
grad =
1.0e-005 *
0.1580
-0.1222
0.0566...
Regístrate para leer el documento completo.