Azzera filtri
Azzera filtri

how pulse generation can be integrated with trigger block ?

2 visualizzazioni (ultimi 30 giorni)
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

Risposte (0)

Categorie

Scopri di più su Schedule Model Components in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by