Function won't show up on plot
2 views (last 30 days)
Hi, so I'm supposed to create a rectangular signal (with 1 period) that looks as the screenshot posted:
where I have 4 input parameters: "T" as the period input in seconds, "Ti" as the duty cycle input in seconds too, H as the "High" - Level of the signal and L as the "Low" - Level of the signal.
So, I created a function to achieve that:
function [yg, t] = Task1Try2(T,Ti,H,L,N)
xlabel("Zeit in S");
By the way idk how to put matlab code in here as smooth in those "boxes", feel free 2 let me know.
I have a suspicion that the problem is that I do not assign each "t" value with a proper "y"/"yges" value, but how do I get that done? I don't want the Y values changed by the t value so....
Thanks in advance!
Jyotsna Talluri on 3 Oct 2019
For creating the rectangular pulse waveform, there is an inbuilt function phased.RectangularWaveform in Phased Array System Toolbox .You can try using that
du = N*1/waveform.PRF;
tsam = du*waveform.SampleRate;
t = unigrid(0,1/waveform.SampleRate,du,'[)');
Refer to the below link for more information