Hi Abdelrhman Abdelfatah,
I understand that you want to create a Simulink source block that can generate an FM signal using the "m" function that you have provided. This is same as loading a "timeseries" data generated using the "m" function into the Simulink model using a "From Workspace" (simin) block.
The following documentation provides an example as to how to load timeseries data using the "simin" block in a Simulink model:
More specifically, look at the "Load timeseries Data" section in the documentation:
As shown in the example, you can do the following in your Simulink file:
- Create a "Callback Button" block, populate the "ClickFcn" with the following code and click on the button (or) go to Model Settings > Model Properties > Callbacks and populate the "InitFcn" with the following code:
m = @(t)-sawtooth(2*pi*(t+0.5));
- Add a "From Workspace" (simin) block to your Simulink model.
- Connect it to a "Scope" block or an "Out" block to view the results.
- Change the simulation "Stop Time" to 2.0s (since your upper bound for t is 2).
- Update the model and run.
The result would look like something as follows: