how pulse generation can be integrated with trigger block ?

3 views (last 30 days)
Hi, I generated pulse by using below code and now I want to trigger my sampler on every rising edge but the trigger subsystem is not getting trigger even there is change in the pulse value from -1 to 1 or 1 to -1. could anyone please know how I can integrate the pulse block with trigger subsystem ? This trigger block is working when I use ideal clock generation but here I generated my own clock using square function but the trigger subsystem is not working here. I attached snap .
function y = pulse
coder.extrinsic('square')
persistent sq;
persistent i;
if isempty(sq) % Initialization sq=0; end
if isempty(i) % Initialization i=1; end
fs = 10000;
t=0:1/fs:0.1;
f = 100;
while (i<1000)
sq = square(2*pi*f*t(i),40)';
i=i+40;
break;
end
y=sq;
Please help me.
Thanks

Answers (0)

Categories

Find more on Schedule Model Components in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!