TJCLK
TJCLK

Reputation: 183

build the following periodic source in Simulink

Anyone could suggest how to build the following periodic source in Simulink? The left part is sine wave

The period is 0.8 seconds. From 0 to 0.3 sec, it is a half sine function (positive half, period 0.6 sec) with amplitude 100; from 0.3 to 0.8, equal to 0

thanks:)

Upvotes: 1

Views: 315

Answers (1)

Phil Goddard
Phil Goddard

Reputation: 10762

Define the time and data vectors in the MATLAB Workspace such as

>> t = linspace(0,0.8,100)';
>> u = 100*sin(pi/0.3*t);
>> u(t>=0.3) = 0;

then in Simulink use the Repeating Sequence source block with time vector set to be variable t and data vector set to be variable u.

Upvotes: 2

Related Questions