Error using DynamicSystem/lsim
    4 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Seow Yen Yew
 il 23 Giu 2020
  
    
    
    
    
    Modificato: Alberto Mora
      
 il 24 Giu 2020
            Error using DynamicSystem/lsim (line 84)
When simulating the response to a specific input signal, the input data U must be a matrix of numeric values with at least
two rows (samples) and without any NaN or Inf.
Error in ssQ6B (line 9)
v0=lsim(H,vi,t);
hi i keep getting this error when i run the following code . could anyone help?? Much appreciate
clc;close all;clear all;
syms t;
H=tf(4,[5 5]);
vi=(10.*(sin(10*t))).*(t<=18);
v0=lsim(H,vi,t);
plot(t,v0);xlabel('t');ylabel('v0(t)')
ylim([-0.8,0.8])
0 Commenti
Risposta accettata
  Alberto Mora
      
 il 23 Giu 2020
        
      Modificato: Alberto Mora
      
 il 24 Giu 2020
  
      Please, do not use symbolic variables for the time array.
t=0:0.01:10;
H=tf(4,[5 5]);
vi=(10.*(sin(10*t))).*(t<=18);
v0=lsim(H,vi,t);
plot(t,v0);xlabel('t');ylabel('v0(t)')
If this helps, consider accepting the answer as a sign of gratitude.
0 Commenti
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

