function periodic in matlab
显示 更早的评论
i have a function (f=x^2 for -pi/2<=x<=pi/2) and i want to make this function periodic , how i can do it?
回答(1 个)
I think this does what you want:
x = -3*pi : 0.01 : 3*pi;
f = @(x) (mod(x+pi/2,pi) - pi/2).^2;
figure
plot(x,f(x))
类别
在 帮助中心 和 File Exchange 中查找有关 Get Started with MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
