필터 지우기
필터 지우기

how pulse generation can be integrated with trigger block ?

조회 수: 2 (최근 30일)
Sarfaraz Ahmed
Sarfaraz Ahmed 2018년 11월 5일
편집: Sarfaraz Ahmed 2018년 11월 5일
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