Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create following signal/function in MATLAB 1

Status
Not open for further replies.

Controlnoob1

Electrical
Apr 29, 2012
4
Hi everyone!

I want to obtain the following function in MATLAB.

Untitled.png


I created the same in SIMULINK and used "to workspace" block to transfer it to MATLAB workspace.

But the transferred signal is of unequal sample intervals. Hence Im unable to use "lsim" to simulate my transfer function in MATLAB.

Thank you!
 
Replies continue below

Recommended for you

Change the solver to a descritized one in the configuration parameters. Put say 0.001s interval to start with.

[peace]
Fe (IronX32)
 
Thank you FeX32!

I changed the SIMULINK solver type from a variable type(default, ode45 used to preserve accuracy with minimum number of samples) to fixed type with a sampling period of 0.001 sec.

It works only for a simulation time of < 1 sec.



 
No problem!
Glad it works for you.

[peace]
Fe (IronX32)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor