Está en la página 1de 3

GRAFICAS EN EL MATLAB

%programa para graficar tiempo espacio, velocidad, aceleracion


clc
clear all
%x(x)= 25t^3+10t^2+t+250
%x=[25 10 1 + 250 ];
%polyder(x)
%polyval(x,t)
x=[25 10 1 + 250 ];
v=polyder(x);
a=polyder(v);
for t=1:10
m(t)=polyval(x,t);
n(t)=polyval(v,t);
k(t)=polyval(a,t);
hold on;grid on;
subplot(2,2,1);plot(t,m(t),'b*');title('Tiempo Espacio');xlabel('tiempo');ylabel('esapcio');
hold on;grid on;
subplot(2,2,2);plot(t,n(t),'rx');title('Tiempo Velocidad');xlabel('tiempo');ylabel('Velocidad');
hold on;grid on;
subplot(2,2,3);plot(t,k(t),'ko');title('Tiempo Aceleracion');xlabel('tiempo');ylabel('Acelecracion');
hold on;grid on;
end
disp('************************************************************')
disp('
Tiempo - Espacio - Velocidad - Aceleracion')
disp('************************************************************')
fprintf('tiempo%d\t');fprintf(' %5s\t','');
fprintf('Espacio%d\n');fprintf(' %5s\t','');
fprintf('Velociad%d\t');fprintf(' %5s\t','');
fprintf('Aceleracio%s\n','n');
disp('------------------------------------------------------------')
for h=1:10
fprintf('%s\t','');
fprintf('%d\t',h);
fprintf('%15.0f\t',m(h));
fprintf('%15.0f\t',n(h))
fprintf('%15.0f\n',k(h))
end
disp('**************************************************************')

TICONA SAENZ JORDAN PAUL

TICONA SAENZ JORDAN PAUL

También podría gustarte