En créant une fonction du premier ordre
Matlab me retourne cette erreur:
Error using DynamicSystem/lsim (line 85)
When simulating the response to a specific input signal, the input data U
must be a matrix with as many rows as samples in the time vector T, and
as many columns as input channels.
Error in lsim (line 115)
[yout,t1,x] = lsim(sys,u,t,x0);
Alors que lorsque je fais mes calculs en dehors de ma fonction celle ci fonctionne, je t'avouerais ne pas trop comprendre:
voila ma fonction
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| function [output] = premier_ordre (K, Tau,t,t_off,t_on)
num=[K];
den=[Tau 1];
x=(length(t)+1)*t_off;
z=(length(t)+1)*t_on;
input=[zeros(1,x) ones(1,z)];
output=lsim(num,den,input,t)
end |
Voila comment je l'appele:
[N3]=premier_ordre(30,9,t,0.5,0.95)
Partager