How to get a sin function in simulink
62 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I need a sin function in Simulink to calculate something like 5sin((x/20000)t). I have tried to create a function with 5*sin((u(1)/20000)*t) but I get a syntax error.
edit: I actually need to add two signals 5sin((x/20000)t) and 10cos((x/30000)t)
0 Commenti
Risposte (2)
Jim Riggs
il 15 Dic 2017
Modificato: Jim Riggs
il 15 Dic 2017
I'm a little confused by the problem statement. Inside the sine function you have x/2000 * t. I'm not sure which represents the independent variable (i.e. is it a function on x or t? Is it a function on t where x is a constant?) I will assume that the function is based on time, t and x is a coefficient.
In Simulink you have a couple of choices. First is the "sin trigonometric function" block. This block simply performs the sin function on the input signal. Assuming the input signal is time, you will have to construct an input signal with a gain (multiplier) of x/2000, then multiply the output by 5 to get {5 sin (x/2000 t)}
Another option is to use the "sine wave function" block. This block has settings for "amplitude", "bias", "Frequency", and "Phase".
Set Phase to zero for a sine function, and to pi/2 for a cosine function.
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!