Why doesn't it work ? Please help

1 次查看(过去 30 天)
David
David2023-3-16
编辑: VBBV ,2023-3-16
Hey!
I need to write this function , but i have tried it and it doesn't work.
Where am I wrong ?
  2 个评论

请先登录,再进行评论。

回答(1 个)

KSSV
KSSV 2023-3-16
dt = 0.01;
t = 4;
T = 0:dt:t;
% First Quarter
r1 = 0:dt:t/4 ;
p1 = sin(pi.*r1) ;
plot (r1,p1)
% Define second Quarter here and append it to the above
  2 个评论
VBBV
VBBV 2023-3-16
编辑:VBBV 2023-3-16
% Second Quarter
r2 = t/4:dt:t/2
p2 = zeros(size(r2));
y = [p1 , p2]
figure(2)
plot([r1 r2],y)
Try it as above

请先登录,再进行评论。

类别

Find more on 2-D and 3-D Plots in Help Center and File Exchange

标签

Community Treasure Hunt

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

Start Hunting!

Translated by