I discover how to do that with https://es.mathworks.com/videos/frequency-response-estimation-68884.html but I am still having problems:
The bode plot become weird after a half of the switching frequency. That do not make sense, because I am not using any digital system. I attach an example: I am simulating a buck converter, with 100 kHz of switching frequency. I only show the part where the weird response starts. Figure 1 shows the expected Bode graph (Vout/duty):
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/374156/image.png)
And the bode plot obtained from linearization the system using simulink (Vout/duty). Figure 2:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/374161/image.png)
The weird behaviour is expected at 628000 rad/s, not at 314000 rad/s.
For the last image, I use "Sinestream":
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/374166/image.png)
Could anyone tell me what is happening? Again, thank you very much for your time.