how plot s(t)

2 次查看(过去 30 天)
clowen
clowen 2016-3-3
where s(t)= cos(t/2)cos(w*t)-sin(t/2)sin(w*t) where 0 < t< pi w=1000

回答(2 个)

Stalin Samuel
Stalin Samuel 2016-3-3
% for example
t=0.1:0.1:pi
s= cos(t/2).*cos(w*t)-sin(t/2).*sin(w*t)
plot(s)
  1 个评论
clowen
clowen 2016-3-3
w=2*pi*1.0E+5; s1=@(t) cos(t/2).*cos(w*t) .*((0 t) & (t <= pi)); > s12=@(t) sin(t/2).*cos(w*t) .*((0 t) & (t<= pi)); > q=@(t) s1+s12; linspace(0,pi); plot(t,q(t)); whats wrong with the above program

请先登录,再进行评论。


Star Strider
Star Strider 2016-3-3
You’re not calling the functions themselves in your ‘q’ assignment. Change it to:
q=@(t) s1(t)+s12(t);

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by