I try to use the Sample and Hold function, to show its output on the spectrum analyzer. But it gives me this error "Spectrum cannot be displayed for continuous or infinite sample times", while I dont have infinite, not continuous sample times. The scope shows the output just fine thought.
I want the output of my "Sample and hold" block to be shown on the spectrum analyzer.
EDIT:
@Tony Stewart EE75 is right. For some reason the pulse generator for the "Sample and hold" filter behaves like a real pin's output, and if a higher output frequency is used for the trigger, it starts losing its shape.
Here are the settings that can work the simulation just fine (I lowered the trigger frequency to 1900):
And here below one can notice two things:
that I have increased the frequency of the PWM output for the trigger, and the pulse is not square anymore.
Even though I have increased the frequency of the trigger, because I opened a new MATLAB window, the spectrum analyzer works now! So the previous window was bugged.
Someone who had the same issue as me: https://www.mathworks.com/matlabcentral/answers/296993-how-can-i-generate-a-high-frequency-signal-with-simulink