
how to plot m(t)=cos(2*pi*9*t) 0<t<3 and m(t)=0 otherwise
    4 ビュー (過去 30 日間)
  
       古いコメントを表示
    
how to plot m(t)=cos(2*pi*9*t) 0<t<3 and m(t)=0 otherwise
0 件のコメント
採用された回答
  Star Strider
      
      
 2016 年 3 月 15 日
        This works:
m = @(t) cos(2*pi*9*t) .* ((t > 0 ) & (t < 3));
t = linspace(-1, 4, 500);
Out = m(t);
figure(1)
plot(t, Out)
grid

2 件のコメント
  Star Strider
      
      
 2016 年 3 月 15 日
				Change the ‘t’ assignment to:
t = linspace(-1, 4, 5000);
to improve the resolution by a factor of 10. Increase the third argument (here 5000) to get the resolution you want, if this is not enough.
その他の回答 (3 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



