how pulse generation can be integrated with trigger block ?

3 次查看(过去 30 天)
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Schedule Model Components 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by