![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1175433/image.jpeg)
Issue with doing FM on SIMULINK
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Abdelrhman Abdelfatah
il 29 Ott 2022
Modificato: Jim Riggs
il 31 Ott 2022
Hello, I want to run the following Model, but it keeps giving me that error how can I fix it please?
Secondly, I want to replace that Message 1 Box, with the following input from my code, how can I do this?
fs=1000;
t = 0:1/fs:2;
% Defining the messages signal m(t)
message =@(t) -sawtooth(2*pi*(t+0.5)) ;
Thank you
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1173488/image.png)
0 Commenti
Risposta accettata
Jim Riggs
il 31 Ott 2022
Modificato: Jim Riggs
il 31 Ott 2022
1) The error is generated because the integration block is a continuous block, and you have specified a discrete solver.
Change the solver type to "Auto" in the model settings.
2) You can code the function that you want using a "MATLAB Function" block (found under the user-defined functions tab).
Assuming that variable "t" is time in your function, you will have to supply t as an input;
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1175433/image.jpeg)
Inside the MATLAB function block you provide the following code:
function y = fcn(t)
y = -sawtooth(2*pi*(t+0.5));
You can control the signal by setting the parameters for the solver. For example, set the solver to "fixed time step" and specify a time step of .001. Set the simulation stop time to 2. This will create a sawtooth signal from 0 to 2 with a 0.001 step size.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Sources in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!