how pulse generation can be integrated with trigger block ?

3 visualizaciones (últimos 30 días)
Sarfaraz Ahmed
Sarfaraz Ahmed el 5 de Nov. de 2018
Editada: Sarfaraz Ahmed el 5 de Nov. de 2018
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

Respuestas (0)

Categorías

Más información sobre Schedule Model Components en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by