How to find response
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Emmanouel Lagoudakis
il 29 Nov 2014
Modificato: Azzi Abdelmalek
il 29 Nov 2014
Hello, I put the following system in matlab but I get an error
"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."
Can someone explain it to me? Thank you.
A = [3 0;0 -2];
B = [3 0;0 -2];
C = [-1 1;1 -1];
D=0;
x0 = [1 -1];
poles = eig(A)
% open-loop response:
t = 0:0.01:5;
u = 0*t;
sys = ss(A,B,C,D);
[y,t,x] = lsim(sys,u,t,x0);
plot(t,y)
0 Commenti
Risposta accettata
Azzi Abdelmalek
il 29 Nov 2014
A = [3 0;0 -2];
B = [3 0;0 -2];
C = [-1 1;1 -1];
D=0;
x0 = [1 -1];
poles = eig(A) % You have unstable poles (pole=3)
% open-loop response:
t = (0:0.01:5)';
u = [sin(t) sin(t)] % create your input signals
sys = ss(A,B,C,D);
[y,t,x] = lsim(sys,u,t,x0);
plot(t,y)
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Time and Frequency Domain Analysis in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!