How does lsim work?
조회 수: 116 (최근 30일)
이전 댓글 표시
Hye.
I've been trying to figure out how the lsim function works in MATLAB. Does it do a time domain solution or a frequency domain solution? I am basically trying to solve a transfer function using lsim. The solution works out perfectly fine, but I have been trying to understand the theory behind how it works. I am very new to MATLAB, so kindly explain the basics if you've got time. THanks
댓글 수: 0
채택된 답변
Robert U
2020년 3월 10일
Hi shahzer rahman,
your question is answered within Matlab documentation: lsim(), linking to ltitr() (which unfortunately does not have a documentation entry in the current version, built-in function, see below) and filter().
open ltitr
%LTITR Linear time-invariant time response kernel.
%
% X = LTITR(A,B,U) calculates the time response of the
% system:
% x[n+1] = Ax[n] + Bu[n]
%
% to input sequence U. The matrix U must have as many columns as
% there are inputs u. Each row of U corresponds to a new time
% point. LTITR returns a matrix X with as many columns as the
% number of states x, and with as many rows as in U.
%
% LTITR(A,B,U,X0) can be used if initial conditions exist.
% Here is what it implements, in high speed:
%
% for i=1:n
% x(:,i) = x0;
% x0 = a * x0 + b * u(i,:).';
% end
% x = x.';
% Copyright 1984-2007 The MathWorks, Inc.
% built-in function
Same question here: Matlab forum
Your core question answered short: lsim solves your system response in time domain.
Kind regards,
Robert
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!