Plotting cos functions in matlab

35 次查看(过去 30 天)
Can someone tell me how you would plot a cos function into matlab so that you can see a few periods of the graph? I am trying to graph
v(t)= 5.6576cos(377t+44.9945)
where the 44.9945 is the angle for the phase. I am also trying to get
v1(t)= 10cos(377t)
for a few periods

采纳的回答

the cyclist
the cyclist 2015-3-23
编辑:the cyclist 2025-2-4
omega = 377;
t = (0:0.01:(6*pi))/omega;
v = 5.6576*cos(omega*t+44.9945);
v1 = 10*cos(omega*t);
figure
h = plot(t,v,t,v1);
legend(h,{'v','v1'})

更多回答(1 个)

mohammed
mohammed 2025-1-20
编辑:Walter Roberson 2025-2-4
t = 0:0.01:(2*pi);
x = cos(t);
y = sin(t);
plot(t,x,'k'); hold on;
plot(t,y,'r-.');
axis([0 2*pi -1.5 1.5])
legend('cos(t)','sin(t)','Location','NorthEast')

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by