Plotting Sinusoidal Wave Graph on MatLab

I want to plot the graph of this sinusoidal equation on matlab but I could not accomplished right...
Here is my sinusoidal wave equation:
v(t) = 5cos(1256t - pi/4)

 採用された回答

William Rose
William Rose 2021 年 5 月 25 日

1 投票

Start by figuring out a good time range. Since you have cos(1256t-pi/4), the period is , so let's plot for two periods, i.e. time=0 to 0.01:
t=0:.0005:0.01; %create vector of time values, with step size=0.0005
x=5*cos(1256*t-pi/4); %compute x(t)
plot(t,x,'r.-') %plot
Try it.

5 件のコメント

cikalekli
cikalekli 2021 年 5 月 25 日
Thanks a lot, you are very well demonstrated your answer.
cikalekli
cikalekli 2021 年 5 月 25 日
My qustion is, the curves are still looks too sharp. How can I plot it with a smooth shape please?
William Rose
William Rose 2021 年 5 月 25 日
@cikalekli, Make the time step size smaller. Try 0.0001, insead of 0.0005 previously:
t=0:.0001:0.01; %create vector of time values, with step size=0.0001
x=5*cos(1256*t-pi/4); %compute x(t)
plot(t,x,'r.-') %plot
cikalekli
cikalekli 2021 年 5 月 25 日
Now I got it how can I approach this form. You are truly perfect... Thank you a lot again
William Rose
William Rose 2021 年 5 月 25 日
You're welcome, cikalekli.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by