Formulario Matlab

Páginas: 3 (588 palabras) Publicado: 20 de marzo de 2013
% Generar vector de t
n = 50; %número de datos
t0 = 0; tf = 10;
t = linspace(t0,tf,n);
% Generar yi, y2, y3
y1 = 2*cos(t);
y2 = sin(t);
y3 = cos(t) + sin(t);
figure(1)plot(t,y1,'y*-',t,y2,'b.-',t,y3,'m+-')
legend('y_{1}','y_{2}','y_{3}',0)
xlabel('Tiempo(seg)')
ylabel('funciones')
grid
title('funciones')
figure(2)
subplot(3,1,1),plot(t,y1,'y*-') (Renglon, graficas/columna,posición)
subplot(3,1,2),plot(t,y2,'b.-')
subplot(3,1,3),plot(t,y3,'m+-')
y4 = 50*cos(t);
figure(3)
plot(t,y4,'y*-',t,y2,'b.-',t,y3,'m+-')
legend('y_{1}','y_{2}','y_{3}',0)
xlabel('Tiempo(seg)')ylabel('funciones')
plotyy(t,y2,t,y4)
figure(5)
yn = [y2;y3]';
t1 = [t;t;]';
plot(t1,yn)
figure(6)
plotyy(t,yn,t,y4)
%Se tiene monóxido de carbono a una temperatura inicial de 180 °R y secalienta a una
%temperatura tal que el CO presente un cambio de entalpía (?H) de 400 BTU/lb. ¿A qué
%temperatura se calienta el gas?
clc; clear all; close all;
H = 400; % BTU/lb
A = 4.778;
B =0.114433;
C = 0.101132E-3;
D = -0.026494E-6;
E = 0.034706E-10;
F = -0.013140E-14;
pol = [F E D C B 0];
T1 = 180; % Rankine;
chorizo = polyval(pol,T1);
pol1 = [pol(1:5) - H - chorizo];
T2 =roots([pol(1:5) -H-chorizo])

% EJERCICIO 4
a = 1.56414E8;
b = 44.897;
R = 83.14; % cm.bar/gmol.K
P = 13.76; %bar
T = 333; %Kelvin
c = (R*T)/P
d = (b^2 + (b*R*T)/P -a/(sqrt(T)*P))
e =(a*b)/(sqrt(T)*P)
V = [1 -c -d -e]

% Ejercicio de Fases

A1 = 6.89745; B1 = 1206.350; C1 = 220.237;
A2 = 6.87773; B2 = 1171.530; C2 = 224.366;
P = input('presion (mmHg):');
%P=760
T1 =(-B1/(log10(P) -A1))-C1;
T2 = (-B2/(log10(P) -A2))-C2;
datos = 10;
if T1= 0 && y < 0
f = x + y^2
elseif x < 0 && y >= 0
f = x^2 + y
else x < 0 && y < 0
f = x^2 + y^2end
R=2;
R = input('\n Quieres iniciar otra vez? (Si=1, No=otro)')
End

%Graficar las siguientes funciones en tres dimensiones para x,y ? [–4, 4]
clc; clear all
%Definir x,y
vmin =...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • matlab
  • matlab
  • Matlab
  • Matlab
  • matlab
  • MATLAB
  • MATLAB
  • Matlab

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS