Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Sinusoidal response

Subject: Sinusoidal response

From: Sreevas

Date: 28 Jun, 2010 10:11:05

Message: 1 of 14

I am only a second day user of matlab. How can I find the sinusoidal response of a system? I have a low pass filter for which I found the impulse response and step response by step(...) and impulse(...) functions respectively.But what is the way to find the sinusoidal response of the low pass filter?

Subject: Sinusoidal response

From: Wayne King

Date: 28 Jun, 2010 10:20:21

Message: 2 of 14

"Sreevas " <mailsreevas@gmail.com> wrote in message <i09sfp$qua$1@fred.mathworks.com>...
> I am only a second day user of matlab. How can I find the sinusoidal response of a system? I have a low pass filter for which I found the impulse response and step response by step(...) and impulse(...) functions respectively.But what is the way to find the sinusoidal response of the low pass filter?

Hi, Based on your post, I'm not sure whether you are modeling an analog or discrete-time system, but see

>>doc freqs

or

>>doc freqz

Hope that helps,
Wayne

Subject: Sinusoidal response

From: Sreevas

Date: 28 Jun, 2010 12:33:20

Message: 3 of 14

i am jus modelling a system having a resistance and capacitance. Where can i find the doc freqs?
"Wayne King" <wmkingty@gmail.com> wrote in message <i09t15$2le$1@fred.mathworks.com>...
> "Sreevas " <mailsreevas@gmail.com> wrote in message <i09sfp$qua$1@fred.mathworks.com>...
> > I am only a second day user of matlab. How can I find the sinusoidal response of a system? I have a low pass filter for which I found the impulse response and step response by step(...) and impulse(...) functions respectively.But what is the way to find the sinusoidal response of the low pass filter?
>
> Hi, Based on your post, I'm not sure whether you are modeling an analog or discrete-time system, but see
>
> >>doc freqs
>
> or
>
> >>doc freqz
>
> Hope that helps,
> Wayne

Subject: Sinusoidal response

From: Faraz Afzal

Date: 28 Jun, 2010 12:51:05

Message: 4 of 14

"Sreevas " <mailsreevas@gmail.com> wrote in message <i09sfp$qua$1@fred.mathworks.com>...
> I am only a second day user of matlab. How can I find the sinusoidal response of a system? I have a low pass filter for which I found the impulse response and step response by step(...) and impulse(...) functions respectively.But what is the way to find the sinusoidal response of the low pass filter?


Wow.. It makes me so happy when i See people asking intereting question and then loooking at the power of Matlab turn to it forever..

Here is the way to simulate ur response..
u will use gensig command.
To generate a sine wave of
PERIOD = 3 sec,
DURATION = 10 sec
SAMPLED AT = 0.1 sec
Use this..
[u,t] = gensig('sin',3,10,0.1)

Once you achieved it use this to find response..
lsim(sys,u,t)

Let me know if it was help..

Regards,
Muhammad Faraz

Subject: Sinusoidal response

From: Wayne King

Date: 28 Jun, 2010 12:55:23

Message: 5 of 14

"Sreevas " <mailsreevas@gmail.com> wrote in message <i0a4qg$id2$1@fred.mathworks.com>...
> i am jus modelling a system having a resistance and capacitance. Where can i find the doc freqs?
> "Wayne King" <wmkingty@gmail.com> wrote in message <i09t15$2le$1@fred.mathworks.com>...
> > "Sreevas " <mailsreevas@gmail.com> wrote in message <i09sfp$qua$1@fred.mathworks.com>...
> > > I am only a second day user of matlab. How can I find the sinusoidal response of a system? I have a low pass filter for which I found the impulse response and step response by step(...) and impulse(...) functions respectively.But what is the way to find the sinusoidal response of the low pass filter?
> >
> > Hi, Based on your post, I'm not sure whether you are modeling an analog or discrete-time system, but see
> >
> > >>doc freqs
> >
> > or
> >
> > >>doc freqz
> >
> > Hope that helps,
> > Wayne

It's a function in the Signal Processing Toolbox.

Wayne

Subject: Sinusoidal response

From: Steven Lord

Date: 28 Jun, 2010 13:24:59

Message: 6 of 14


"Sreevas " <mailsreevas@gmail.com> wrote in message
news:i0a4qg$id2$1@fred.mathworks.com...
>i am jus modelling a system having a resistance and capacitance. Where can
>i find the doc freqs?

In this newsgroup, when you see someone write:

    doc <some name>

or

    help <some name>

you should type that command at the MATLAB prompt. So type:

    doc freqs

all as one command and then press Enter and the Help Browser will bring up
the documentation for the FREQS command. After reading that documentation,
you can decide if it does what you want to do and if so, it will show you
the syntax to use to call the function. If not, try again using:

    doc freqz

instead. If that too doesn't do what you want, the Help Browser includes
search capability, so you can search using appropriate keywords to find the
information you want.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Sinusoidal response

From: Sreevas

Date: 28 Jun, 2010 15:08:14

Message: 7 of 14

"Faraz Afzal" <farazafzal@gmail.com> wrote in message <i0a5rp$pf1$1@fred.mathworks.com>...
> "Sreevas " <mailsreevas@gmail.com> wrote in message <i09sfp$qua$1@fred.mathworks.com>...
> > I am only a second day user of matlab. How can I find the sinusoidal response of a system? I have a low pass filter for which I found the impulse response and step response by step(...) and impulse(...) functions respectively.But what is the way to find the sinusoidal response of the low pass filter?
>
>
> Wow.. It makes me so happy when i See people asking intereting question and then loooking at the power of Matlab turn to it forever..
>
> Here is the way to simulate ur response..
> u will use gensig command.
> To generate a sine wave of
> PERIOD = 3 sec,
> DURATION = 10 sec
> SAMPLED AT = 0.1 sec
> Use this..
> [u,t] = gensig('sin',3,10,0.1)
>
> Once you achieved it use this to find response..
> lsim(sys,u,t)
>
> Let me know if it was help..
>
> Regards,
> Muhammad Faraz

Thanks a lot for the info. But how can I apply this to the matrix that I have created. I have 2 x 2 matrix for the low pass filter nd i gave step of (a b c d) to find step response. What sud i do for sinusoidal response?

Subject: Sinusoidal response

From: Faraz Afzal

Date: 28 Jun, 2010 16:43:26

Message: 8 of 14

"Sreevas " <mailsreevas@gmail.com> wrote in message <i0adsu$p4n$1@fred.mathworks.com>...
> "Faraz Afzal" <farazafzal@gmail.com> wrote in message <i0a5rp$pf1$1@fred.mathworks.com>...
> > "Sreevas " <mailsreevas@gmail.com> wrote in message <i09sfp$qua$1@fred.mathworks.com>...
> > > I am only a second day user of matlab. How can I find the sinusoidal response of a system? I have a low pass filter for which I found the impulse response and step response by step(...) and impulse(...) functions respectively.But what is the way to find the sinusoidal response of the low pass filter?
> >
> >
> > Wow.. It makes me so happy when i See people asking intereting question and then loooking at the power of Matlab turn to it forever..
> >
> > Here is the way to simulate ur response..
> > u will use gensig command.
> > To generate a sine wave of
> > PERIOD = 3 sec,
> > DURATION = 10 sec
> > SAMPLED AT = 0.1 sec
> > Use this..
> > [u,t] = gensig('sin',3,10,0.1)
> >
> > Once you achieved it use this to find response..
> > lsim(sys,u,t)
> >
> > Let me know if it was help..
> >
> > Regards,
> > Muhammad Faraz
>
> Thanks a lot for the info. But how can I apply this to the matrix that I have created. I have 2 x 2 matrix for the low pass filter nd i gave step of (a b c d) to find step response. What sud i do for sinusoidal response?

Ahaan...

OK after forming your A, B C matrices ..
 D = 0 feed through matrix normally...
Form a State space of this using..
sys = ss(a,b,c,0);
To find step response of thi ssystem you will write
step(sys)
and for sine wave response I already told u what to do...

Let me know if it worked..
Regards
Muhammad Faraz

Subject: Sinusoidal response

From: Sreevas

Date: 29 Jun, 2010 09:32:04

Message: 9 of 14

"Sreevas " <mailsreevas@gmail.com> wrote in message <i0adsu$p4n$1@fred.mathworks.com>...
> "Faraz Afzal" <farazafzal@gmail.com> wrote in message <i0a5rp$pf1$1@fred.mathworks.com>...
> > "Sreevas " <mailsreevas@gmail.com> wrote in message <i09sfp$qua$1@fred.mathworks.com>...
> > > I am only a second day user of matlab. How can I find the sinusoidal response of a system? I have a low pass filter for which I found the impulse response and step response by step(...) and impulse(...) functions respectively.But what is the way to find the sinusoidal response of the low pass filter?
> >
> >
> > Wow.. It makes me so happy when i See people asking intereting question and then loooking at the power of Matlab turn to it forever..
> >
> > Here is the way to simulate ur response..
> > u will use gensig command.
> > To generate a sine wave of
> > PERIOD = 3 sec,
> > DURATION = 10 sec
> > SAMPLED AT = 0.1 sec
> > Use this..
> > [u,t] = gensig('sin',3,10,0.1)
> >
> > Once you achieved it use this to find response..
> > lsim(sys,u,t)
> >
> > Let me know if it was help..
> >
> > Regards,
> > Muhammad Faraz
>
> Thanks a lot for the info. But how can I apply this to the matrix that I have created. I have 2 x 2 matrix for the low pass filter nd i gave step of (a b c d) to find step response. What sud i do for sinusoidal response


Thanks once again. When I tried it out this was the result that i got .What could be the possible solution to this?

>> [u.t]=gensig('sin',3,10,0.1)

u =

    t: [101x1 double]

>> sys=ss(1,2,3,0)
 
a =
       x1
   x1 1
 
 
b =
       u1
   x1 2
 
 
c =
       x1
   y1 3
 
 
d =
       u1
   y1 0
 
Continuous-time model.
>> z=lsim(sys,u,t)
??? Undefined function or variable 't'.

Subject: Sinusoidal response

From: Sreevas

Date: 29 Jun, 2010 10:14:06

Message: 10 of 14

"Faraz Afzal" <farazafzal@gmail.com> wrote in message <i0ajfe$9a9$1@fred.mathworks.com>...
> "Sreevas " <mailsreevas@gmail.com> wrote in message <i0adsu$p4n$1@fred.mathworks.com>...
> > "Faraz Afzal" <farazafzal@gmail.com> wrote in message <i0a5rp$pf1$1@fred.mathworks.com>...
> > > "Sreevas " <mailsreevas@gmail.com> wrote in message <i09sfp$qua$1@fred.mathworks.com>...
> > > > I am only a second day user of matlab. How can I find the sinusoidal response of a system? I have a low pass filter for which I found the impulse response and step response by step(...) and impulse(...) functions respectively.But what is the way to find the sinusoidal response of the low pass filter?
> > >
> > >
> > > Wow.. It makes me so happy when i See people asking intereting question and then loooking at the power of Matlab turn to it forever..
> > >
> > > Here is the way to simulate ur response..
> > > u will use gensig command.
> > > To generate a sine wave of
> > > PERIOD = 3 sec,
> > > DURATION = 10 sec
> > > SAMPLED AT = 0.1 sec
> > > Use this..
> > > [u,t] = gensig('sin',3,10,0.1)
> > >
> > > Once you achieved it use this to find response..
> > > lsim(sys,u,t)
> > >
> > > Let me know if it was help..
> > >
> > > Regards,
> > > Muhammad Faraz
> >
> > Thanks a lot for the info. But how can I apply this to the matrix that I have created. I have 2 x 2 matrix for the low pass filter nd i gave step of (a b c d) to find step response. What sud i do for sinusoidal response?
>
> Ahaan...
>
> OK after forming your A, B C matrices ..
> D = 0 feed through matrix normally...
> Form a State space of this using..
> sys = ss(a,b,c,0);
> To find step response of thi ssystem you will write
> step(sys)
> and for sine wave response I already told u what to do...
>
> Let me know if it worked..
> Regards
> Muhammad Faraz

THanks a lot. The last qn i asked was wrond as i had missed a ',' in between.Your help was very useful particularly becoz thaey came really fast :)

Subject: Sinusoidal response

From: Faraz Afzal

Date: 29 Jun, 2010 10:33:04

Message: 11 of 14

"Sreevas " <mailsreevas@gmail.com> wrote in message <i0ceik$1i$1@fred.mathworks.com>...
> "Sreevas " <mailsreevas@gmail.com> wrote in message <i0adsu$p4n$1@fred.mathworks.com>...
> > "Faraz Afzal" <farazafzal@gmail.com> wrote in message <i0a5rp$pf1$1@fred.mathworks.com>...
> > > "Sreevas " <mailsreevas@gmail.com> wrote in message <i09sfp$qua$1@fred.mathworks.com>...
> > > > I am only a second day user of matlab. How can I find the sinusoidal response of a system? I have a low pass filter for which I found the impulse response and step response by step(...) and impulse(...) functions respectively.But what is the way to find the sinusoidal response of the low pass filter?
> > >
> > >
> > > Wow.. It makes me so happy when i See people asking intereting question and then loooking at the power of Matlab turn to it forever..
> > >
> > > Here is the way to simulate ur response..
> > > u will use gensig command.
> > > To generate a sine wave of
> > > PERIOD = 3 sec,
> > > DURATION = 10 sec
> > > SAMPLED AT = 0.1 sec
> > > Use this..
> > > [u,t] = gensig('sin',3,10,0.1)
> > >
> > > Once you achieved it use this to find response..
> > > lsim(sys,u,t)
> > >
> > > Let me know if it was help..
> > >
> > > Regards,
> > > Muhammad Faraz
> >
> > Thanks a lot for the info. But how can I apply this to the matrix that I have created. I have 2 x 2 matrix for the low pass filter nd i gave step of (a b c d) to find step response. What sud i do for sinusoidal response
>
>
> Thanks once again. When I tried it out this was the result that i got .What could be the possible solution to this?
>
> >> [u.t]=gensig('sin',3,10,0.1)
>
> u =
>
> t: [101x1 double]
>
> >> sys=ss(1,2,3,0)
>
> a =
> x1
> x1 1
>
>
> b =
> u1
> x1 2
>
>
> c =
> x1
> y1 3
>
>
> d =
> u1
> y1 0
>
> Continuous-time model.
> >> z=lsim(sys,u,t)
> ??? Undefined function or variable 't'.

no no no... No dear Sreevaas,,
go to the process step by step. follow the scheme.

1. Setup your A , B , C, and D matrices.
2. sys = ss(A,B,C,D)
3. [u,t]=gensig('sin',3,10,0.1) (There is comma between u and t but
                                                                not a dot like u did in your code.)..
4. z=lsim(sys,u,t)
5 plot(z)

Or if u literally got ur matrices A,B,C,D as 1,2,3,0 , then follow (copy paste):
A = 1
B = 2
C = 3
D = 0
sys= ss(A,B,C,D)
[u,t] = gensig('sin',2,10,0.01);
z = lsim(sys,u,t)
plot(z)

You can change your sine wave by changing its parameters as i explained long time ago.
Regards,
Let me know if it works

Muhammad Faraz

Subject: Sinusoidal response

From: Sreevas

Date: 1 Jul, 2010 12:50:15

Message: 12 of 14

"Faraz Afzal" <farazafzal@gmail.com> wrote in message <i0ci50$gt6$1@fred.mathworks.com>...
> "Sreevas " <mailsreevas@gmail.com> wrote in message <i0ceik$1i$1@fred.mathworks.com>...
> > "Sreevas " <mailsreevas@gmail.com> wrote in message <i0adsu$p4n$1@fred.mathworks.com>...
> > > "Faraz Afzal" <farazafzal@gmail.com> wrote in message <i0a5rp$pf1$1@fred.mathworks.com>...
> > > > "Sreevas " <mailsreevas@gmail.com> wrote in message <i09sfp$qua$1@fred.mathworks.com>...
> > > > > I am only a second day user of matlab. How can I find the sinusoidal response of a system? I have a low pass filter for which I found the impulse response and step response by step(...) and impulse(...) functions respectively.But what is the way to find the sinusoidal response of the low pass filter?
> > > >
> > > >
> > > > Wow.. It makes me so happy when i See people asking intereting question and then loooking at the power of Matlab turn to it forever..
> > > >
> > > > Here is the way to simulate ur response..
> > > > u will use gensig command.
> > > > To generate a sine wave of
> > > > PERIOD = 3 sec,
> > > > DURATION = 10 sec
> > > > SAMPLED AT = 0.1 sec
> > > > Use this..
> > > > [u,t] = gensig('sin',3,10,0.1)
> > > >
> > > > Once you achieved it use this to find response..
> > > > lsim(sys,u,t)
> > > >
> > > > Let me know if it was help..
> > > >
> > > > Regards,
> > > > Muhammad Faraz
> > >
> > > Thanks a lot for the info. But how can I apply this to the matrix that I have created. I have 2 x 2 matrix for the low pass filter nd i gave step of (a b c d) to find step response. What sud i do for sinusoidal response
> >
> >
> > Thanks once again. When I tried it out this was the result that i got .What could be the possible solution to this?
> >
> > >> [u.t]=gensig('sin',3,10,0.1)
> >
> > u =
> >
> > t: [101x1 double]
> >
> > >> sys=ss(1,2,3,0)
> >
> > a =
> > x1
> > x1 1
> >
> >
> > b =
> > u1
> > x1 2
> >
> >
> > c =
> > x1
> > y1 3
> >
> >
> > d =
> > u1
> > y1 0
> >
> > Continuous-time model.
> > >> z=lsim(sys,u,t)
> > ??? Undefined function or variable 't'.
>
> no no no... No dear Sreevaas,,
> go to the process step by step. follow the scheme.
>
> 1. Setup your A , B , C, and D matrices.
> 2. sys = ss(A,B,C,D)
> 3. [u,t]=gensig('sin',3,10,0.1) (There is comma between u and t but
> not a dot like u did in your code.)..
> 4. z=lsim(sys,u,t)
> 5 plot(z)
>
> Or if u literally got ur matrices A,B,C,D as 1,2,3,0 , then follow (copy paste):
> A = 1
> B = 2
> C = 3
> D = 0
> sys= ss(A,B,C,D)
> [u,t] = gensig('sin',2,10,0.01);
> z = lsim(sys,u,t)
> plot(z)
>
> You can change your sine wave by changing its parameters as i explained long time ago.
> Regards,
> Let me know if it works
>
> Muhammad Faraz

I hav one more doubt.How can i find the pulse response when I am using matrices?

Subject: Sinusoidal response

From: Faraz Afzal

Date: 1 Jul, 2010 12:59:06

Message: 13 of 14

"Sreevas " <mailsreevas@gmail.com> wrote in message <i0i2u7$ov9$1@fred.mathworks.com>...
> "Faraz Afzal" <farazafzal@gmail.com> wrote in message <i0ci50$gt6$1@fred.mathworks.com>...
> > "Sreevas " <mailsreevas@gmail.com> wrote in message <i0ceik$1i$1@fred.mathworks.com>...
> > > "Sreevas " <mailsreevas@gmail.com> wrote in message <i0adsu$p4n$1@fred.mathworks.com>...
> > > > "Faraz Afzal" <farazafzal@gmail.com> wrote in message <i0a5rp$pf1$1@fred.mathworks.com>...
> > > > > "Sreevas " <mailsreevas@gmail.com> wrote in message <i09sfp$qua$1@fred.mathworks.com>...
> > > > > > I am only a second day user of matlab. How can I find the sinusoidal response of a system? I have a low pass filter for which I found the impulse response and step response by step(...) and impulse(...) functions respectively.But what is the way to find the sinusoidal response of the low pass filter?
> > > > >
> > > > >
> > > > > Wow.. It makes me so happy when i See people asking intereting question and then loooking at the power of Matlab turn to it forever..
> > > > >
> > > > > Here is the way to simulate ur response..
> > > > > u will use gensig command.
> > > > > To generate a sine wave of
> > > > > PERIOD = 3 sec,
> > > > > DURATION = 10 sec
> > > > > SAMPLED AT = 0.1 sec
> > > > > Use this..
> > > > > [u,t] = gensig('sin',3,10,0.1)
> > > > >
> > > > > Once you achieved it use this to find response..
> > > > > lsim(sys,u,t)
> > > > >
> > > > > Let me know if it was help..
> > > > >
> > > > > Regards,
> > > > > Muhammad Faraz
> > > >
> > > > Thanks a lot for the info. But how can I apply this to the matrix that I have created. I have 2 x 2 matrix for the low pass filter nd i gave step of (a b c d) to find step response. What sud i do for sinusoidal response
> > >
> > >
> > > Thanks once again. When I tried it out this was the result that i got .What could be the possible solution to this?
> > >
> > > >> [u.t]=gensig('sin',3,10,0.1)
> > >
> > > u =
> > >
> > > t: [101x1 double]
> > >
> > > >> sys=ss(1,2,3,0)
> > >
> > > a =
> > > x1
> > > x1 1
> > >
> > >
> > > b =
> > > u1
> > > x1 2
> > >
> > >
> > > c =
> > > x1
> > > y1 3
> > >
> > >
> > > d =
> > > u1
> > > y1 0
> > >
> > > Continuous-time model.
> > > >> z=lsim(sys,u,t)
> > > ??? Undefined function or variable 't'.
> >
> > no no no... No dear Sreevaas,,
> > go to the process step by step. follow the scheme.
> >
> > 1. Setup your A , B , C, and D matrices.
> > 2. sys = ss(A,B,C,D)
> > 3. [u,t]=gensig('sin',3,10,0.1) (There is comma between u and t but
> > not a dot like u did in your code.)..
> > 4. z=lsim(sys,u,t)
> > 5 plot(z)
> >
> > Or if u literally got ur matrices A,B,C,D as 1,2,3,0 , then follow (copy paste):
> > A = 1
> > B = 2
> > C = 3
> > D = 0
> > sys= ss(A,B,C,D)
> > [u,t] = gensig('sin',2,10,0.01);
> > z = lsim(sys,u,t)
> > plot(z)
> >
> > You can change your sine wave by changing its parameters as i explained long time ago.
> > Regards,
> > Let me know if it works
> >
> > Muhammad Faraz
>
> I hav one more doubt.How can i find the pulse response when I am using matrices?


:)) Sreevaas,

YOur doubt comes too late.. for impulse
use impulse(sys),
for step response
 step(sys)

I hope it helps,
Regards,
Muhammad Faraz

Subject: Sinusoidal response

From: Sreevas

Date: 1 Jul, 2010 13:27:05

Message: 14 of 14

"Faraz Afzal" <farazafzal@gmail.com> wrote in message <i0i3eq$rgp$1@fred.mathworks.com>...
> "Sreevas " <mailsreevas@gmail.com> wrote in message <i0i2u7$ov9$1@fred.mathworks.com>...
> > "Faraz Afzal" <farazafzal@gmail.com> wrote in message <i0ci50$gt6$1@fred.mathworks.com>...
> > > "Sreevas " <mailsreevas@gmail.com> wrote in message <i0ceik$1i$1@fred.mathworks.com>...
> > > > "Sreevas " <mailsreevas@gmail.com> wrote in message <i0adsu$p4n$1@fred.mathworks.com>...
> > > > > "Faraz Afzal" <farazafzal@gmail.com> wrote in message <i0a5rp$pf1$1@fred.mathworks.com>...
> > > > > > "Sreevas " <mailsreevas@gmail.com> wrote in message <i09sfp$qua$1@fred.mathworks.com>...
> > > > > > > I am only a second day user of matlab. How can I find the sinusoidal response of a system? I have a low pass filter for which I found the impulse response and step response by step(...) and impulse(...) functions respectively.But what is the way to find the sinusoidal response of the low pass filter?
> > > > > >
> > > > > >
> > > > > > Wow.. It makes me so happy when i See people asking intereting question and then loooking at the power of Matlab turn to it forever..
> > > > > >
> > > > > > Here is the way to simulate ur response..
> > > > > > u will use gensig command.
> > > > > > To generate a sine wave of
> > > > > > PERIOD = 3 sec,
> > > > > > DURATION = 10 sec
> > > > > > SAMPLED AT = 0.1 sec
> > > > > > Use this..
> > > > > > [u,t] = gensig('sin',3,10,0.1)
> > > > > >
> > > > > > Once you achieved it use this to find response..
> > > > > > lsim(sys,u,t)
> > > > > >
> > > > > > Let me know if it was help..
> > > > > >
> > > > > > Regards,
> > > > > > Muhammad Faraz
> > > > >
> > > > > Thanks a lot for the info. But how can I apply this to the matrix that I have created. I have 2 x 2 matrix for the low pass filter nd i gave step of (a b c d) to find step response. What sud i do for sinusoidal response
> > > >
> > > >
> > > > Thanks once again. When I tried it out this was the result that i got .What could be the possible solution to this?
> > > >
> > > > >> [u.t]=gensig('sin',3,10,0.1)
> > > >
> > > > u =
> > > >
> > > > t: [101x1 double]
> > > >
> > > > >> sys=ss(1,2,3,0)
> > > >
> > > > a =
> > > > x1
> > > > x1 1
> > > >
> > > >
> > > > b =
> > > > u1
> > > > x1 2
> > > >
> > > >
> > > > c =
> > > > x1
> > > > y1 3
> > > >
> > > >
> > > > d =
> > > > u1
> > > > y1 0
> > > >
> > > > Continuous-time model.
> > > > >> z=lsim(sys,u,t)
> > > > ??? Undefined function or variable 't'.
> > >
> > > no no no... No dear Sreevaas,,
> > > go to the process step by step. follow the scheme.
> > >
> > > 1. Setup your A , B , C, and D matrices.
> > > 2. sys = ss(A,B,C,D)
> > > 3. [u,t]=gensig('sin',3,10,0.1) (There is comma between u and t but
> > > not a dot like u did in your code.)..
> > > 4. z=lsim(sys,u,t)
> > > 5 plot(z)
> > >
> > > Or if u literally got ur matrices A,B,C,D as 1,2,3,0 , then follow (copy paste):
> > > A = 1
> > > B = 2
> > > C = 3
> > > D = 0
> > > sys= ss(A,B,C,D)
> > > [u,t] = gensig('sin',2,10,0.01);
> > > z = lsim(sys,u,t)
> > > plot(z)
> > >
> > > You can change your sine wave by changing its parameters as i explained long time ago.
> > > Regards,
> > > Let me know if it works
> > >
> > > Muhammad Faraz
> >
> > I hav one more doubt.How can i find the pulse response when I am using matrices?
>
>
> :)) Sreevaas,
>
> YOur doubt comes too late.. for impulse
> use impulse(sys),
> for step response
> step(sys)
>
> I hope it helps,
> Regards,
> Muhammad Faraz

i know impulse(sys) and step(sys)... What i asked was for pulse.I mean like a fn. u(t)-u(t-T).I can find the laplace nd all and then find response.But is there any easier way using some fn.?

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us