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.

조회 수: 30 (최근 30일)
lsim( SS, [2;0.2], t)
this is the code ss is a state space model with 2 inputs and t is 0:0.4:10

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 6월 11일
'u' must have as many rows as the number of elements in 't'. It seems that you want to apply step inputs. Try something like this
t = 0:0.4:10;
u = repmat([2, 0.2], numel(t), 1);
lsim(SS, u, t);
  댓글 수: 3
Ameer Hamza
Ameer Hamza 2020년 6월 12일
You need to specify it as two columns. The number of rows should be the same as the number of elements in t. u is like this
u = [
2 0.2;
2 0.2;
..
..
2 0.2]; % rows same as numel(t)
khaled elmoshrefy
khaled elmoshrefy 2020년 6월 13일
편집: khaled elmoshrefy 2020년 6월 13일
Yeah i searched for these functions on mathworks. It goes like you said ,thanks

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by