How do I offset a repeating sequence?

Hello,
I have two sawtooth functions using two "repeating sequence" blocks. I want to offset the second one by one half of a period (in this case, 15 seconds - one period is 30 seconds).
So then, initially, the first sawtooth would start at 0, and the second would start at 0.5, since the output of each sawtooth is between 0 and 1
I have tried using the "Transport Delay" block to delay the second function, but this gives a value of 0 until the 15 second mark, and for some reason it only allows one period of the sawtooth to pass. Then it just gives a value of 0 constantly.
Any help would be appreciated. Thank you.

댓글 수: 3

David Miller
David Miller 2016년 7월 2일
If f(x) and g(x) are your two saw tooth functions and you would like f(x) and g(x) to be out of phase by dx, can you not just shift the domain of one of them? g(x) -> g(x+dx), here dx is 15 seconds.
HayMakerMaker
HayMakerMaker 2016년 7월 5일
편집: HayMakerMaker 2016년 7월 5일
You would think so, and I tried doing just that. For the parameters for each saw tooth function it asks for a "Time Value" and an "Output Value". I tried setting the time value for the first function for [0, 30] and the second one to [15, 45] while both having the same output values, but the two output functions were identical in the end.
HayMakerMaker
HayMakerMaker 2016년 7월 5일
편집: HayMakerMaker 2016년 7월 5일

Update:

In lieu of a proper answer, I have started doing it "The Hard Way". I algebraically shifted the function using the following sequence. When I compile the program, it runs as it should. The output waveform is what I want, and has an evenly displaced saw tooth function.

HOWEVER: When I attempt to run the program from ControlDesk it gives me the weird flat-topping waveform shown below. I have no idea why only ControlDesk does this. Will keep searching for an answer and hoping someone knows how to do this the proper way.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 General Applications에 대해 자세히 알아보기

질문:

2016년 7월 1일

편집:

2016년 7월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by