问题描述:
帮我看看这段matlab周期函数哪里有问题是
我这个是分段周期函数,显示的错误为:
Error using ==> plot
Vectors must be the same lengths.
我没找出来错误,麻烦帮我看看,
clc;clear;
t1 = [0:0.0001:0.005];
y1 = 1./(1-0.5.*t1.^2).^2;
t2 = [0.005:0.0001:0.015];
y2 = 1./(1+0.5.*t2.^2-0.01.*t2+0.000025).^2;
t3 = [0.015:0.0001:0.02];
y3 = 1./(1-0.5.*t3.^2+0.02.*t3-0.0002).^2;
t = [t1,t2,t3];
y = [y1,y2,y3];
t=[0:0.0001:0.1];
y = repmat(y,1,5); %错误就在上面这两句里!
plot(t,y)
我这个是分段周期函数,显示的错误为:
Error using ==> plot
Vectors must be the same lengths.
我没找出来错误,麻烦帮我看看,
clc;clear;
t1 = [0:0.0001:0.005];
y1 = 1./(1-0.5.*t1.^2).^2;
t2 = [0.005:0.0001:0.015];
y2 = 1./(1+0.5.*t2.^2-0.01.*t2+0.000025).^2;
t3 = [0.015:0.0001:0.02];
y3 = 1./(1-0.5.*t3.^2+0.02.*t3-0.0002).^2;
t = [t1,t2,t3];
y = [y1,y2,y3];
t=[0:0.0001:0.1];
y = repmat(y,1,5); %错误就在上面这两句里!
plot(t,y)
问题解答:
我来补答展开全文阅读