Jump to content
Read_Mynd

Qual o erro do código?

Recommended Posts

Read_Mynd

boas, alguem me sabe dizer o que se passa com este programa para estar a dar erro?

clear;
clc;

% Numerador e denominador das funções transferência
%Deslocamento angular 2
numteta2=[1000 0 10000];
denteta2=[32 1440 3870 104400 74875 900000 0];

%Deslocamento linear
numx=[2500];
denx=[32 1440 3870 104400 74875 900000 0];

%Velocidade angular 2
numw2=[1000 0 10000 0];
denw2=[32 1440 3870 104400 74875 900000 0];

%Velocidade linear
numv=[2500 0];
denv=[32 1440 3870 104400 74875 900000 0];

%Introduçao do intervalo de tempo da simulação
t=linspace(0,20,1000);
tau=[1:1:500];

%Entrada do sistema
for i=1:1000;

   tau(i+1)=5;

end

%Simula a resposta do sistema
[xout,x]=lsim(numx,denx,tau,t);
[tetaout2,teta]=lsim(numteta2,denteta2,tau,t);
[vout,v]=lsim(numv,denv,tau,t);
[w2out,w2]=lsim(numw2,denw2,tau,t);

%Gráfico
%Deslocamento linear/Velocidade angular
figure(1);
plot(t,xout,t,vout)
c=[0,16,0,0.25];
axis(c)
   title  Deslocamento/Velocidade.em.Função.do.Tempo
   xlabel  tempo(s)
   ylabel  x(m)| v(m/s)

%Deslocamento angular/Velocidade angular
figure(2);
plot(t,tetaout2,t,w2out)
c=[0,15,0,0.6];
axis(c)
title Deslocamento.Angular/Velocidade.Angular.em.Funcao.do.Tempo
xlabel  tempo(s)
ylabel  teta2(rad)| w2(rad/s)

Edited by thoga31
GeSHi + título

Share this post


Link to post
Share on other sites
Read_Mynd

Boas, consegui resolver ontem instalando uma versão diferente, pelo que me apercebi o problema era faltar a control toolbox.

Obrigado

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.