MATLAB: Generate the following signals in Simulink

function plotsimulink

Good evening Matlab community. I am a bit new to simulink. I would like to know how to plot the function x(t)= 5*cos(30*pi*t+0.25*pi) using blocks. My attempt is below: but the output is all wrong. How do I plot this function? Am I supposed to use a constant source? the contents of my function block is in the other pic. I want a clear xy plot in the scope. Or do I use the xy plot block? I would appreciate any guidance thank you!

Best Answer

Use a clock as an input in place of sine wave. To reduce the number of cycles you need to modify the function y. If you are looking for 1 cycle/second then use a function similar to y= 5*cos(2*pi*u+0.25*pi)