step responce using lsim command making extra plot .

4 ビュー (過去 30 日間)
tomer polsky
tomer polsky 2021 年 4 月 22 日
回答済み: Sumukh 2024 年 9 月 18 日
I want to make step responce using lsim command ( I know that there is a command names step but I need to do it using lsim command) . so my step is zero while 0<t<10 and is equel to 22 while 10<t<20 . when I use the command lsim . the plot is right but for some reason the output of the plot is giving me extra plot and I dont undestand why does it happen . is it a bug ? or am I using the command lsim wrong ?
clc;clear all;
t1=0:9
t2=10:20;
t=[t1 t2];
y1=0*ones(1,length(t1));
y2=1*ones(1,length(t2));
y3=[y1 y2]; %% step function that starts from 10 ;
sys1 = tf(1,[ 1 0]);%% integrator
lsim(sys1,y3,t); %% responce of step

回答 (1 件)

Sumukh
Sumukh 2024 年 9 月 18 日
Hi Tomer,
I understand that you are referring to the grey line in the plot that appears when “lsim” command generates the figure. The grey line is not a bug but a feature of the lsim command. It is the input signal in the variable “y3” plotted against time variable “t” along with the output signal in blue colour. You can refer to the following documentation link to know more about the figure plotted by lsim command:
I hope this answers your query.

カテゴリ

Help Center および File ExchangeFilter Analysis についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by