How to create own stimulus to drive simulink blocks ?

5 Ansichten (letzte 30 Tage)
Tom
Tom am 21 Feb. 2013
Hello,
I am new to Simulink world. I want to generate my own stimulus to drive my simulink design blocks. I can use the Simulink existing source blocks (such as step, sine etc). But I want to control a group of my signals as the function of simulation time. For example, signal A goes to a value at simulation time T1, then change to a different value at simulation time T2. Similar request for other signals. I am looking a suggestions for to write a simple function (text based is prefered) to achieve this purpose.
Thank you in advance.
-Tom

Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 21 Feb. 2013
Bearbeitet: Azzi Abdelmalek am 21 Feb. 2013
Example:
t1=0:0.1:10
y1=sin(t)
t2=10.1:0.1:20
y2=cos(t)./t
t=[t1 t2];
y=[y1 y2];
ty=[t;y];
save yourfile ty
In your Simulink model use a from file block and set a file name to yourfile.mat
  2 Kommentare
Kaustubha Govind
Kaustubha Govind am 21 Feb. 2013
You can also use the Signal Builder block to do the same thing graphically.
Tom
Tom am 21 Feb. 2013
Thank you Azzi and Kaustubha. I got both methods working. Appreciate your help.
-Tom

Melden Sie sich an, um zu kommentieren.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by