matlab问题Vectors must be the same lengths.
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/07/19 14:56:43
matlab问题Vectors must be the same lengths.
plot(x,y)的时候,应该是x的问题,我的x=0.25:0.01:0.53,可是改成x=-0.53:0.01:0.53就对了,可是我的程序不能那样做,函数在那一段插值区间的时候没有定义,如果非得定义在那儿,会影响我的结果.总之区间不能改,有没有什么函数可以无限制区间的画图啊?
X=[0.25,0.30,0.39,0.45,0.53];
Y=[0.5000,0.5477,0.6245,0.6708,0.7280];
x=0.25:0.01:0.53;
m=length(x);
for i=1:m
y(i)=yangtiao(X,Y,x(i));
end
plot(x,y)
这样的话就会报Vectors must be the same lengths.
plot(x,y)的时候,应该是x的问题,我的x=0.25:0.01:0.53,可是改成x=-0.53:0.01:0.53就对了,可是我的程序不能那样做,函数在那一段插值区间的时候没有定义,如果非得定义在那儿,会影响我的结果.总之区间不能改,有没有什么函数可以无限制区间的画图啊?
X=[0.25,0.30,0.39,0.45,0.53];
Y=[0.5000,0.5477,0.6245,0.6708,0.7280];
x=0.25:0.01:0.53;
m=length(x);
for i=1:m
y(i)=yangtiao(X,Y,x(i));
end
plot(x,y)
这样的话就会报Vectors must be the same lengths.
这说明你遍的函数 yangtiao需要完善.我不太清楚你的意思还有你编的函数.
画函数图当然得x和y 同长度.如果你的意思是对应 x(i) 的 y(i)没有取值的话,可以给 y(i)赋值为 NaN
或者你只画y, plot(y).
画函数图当然得x和y 同长度.如果你的意思是对应 x(i) 的 y(i)没有取值的话,可以给 y(i)赋值为 NaN
或者你只画y, plot(y).
matlab问题Vectors must be the same lengths.
matlab运行遇到问题:Vectors must be the same lengths.
matlab plot 提示错误:Vectors must be the same lengths!
matlab中错误vectors must be the same lengths 是怎么回事?
matlab的Vectors must be the same lengths.错误
matlab提示“Vectors must be the same lengths.
跪等!matlab中Vectors must be the same lengths
matlab总是显示Vectors must be the same lengths,请大师帮忙,
求matlab高手~Error using plot Vectors must be the same lengths问
哪位大侠知道这个MATLAB的错误啊 plot Vectors must be the same lengths.
MATLAB运行错误:Error using plot Vectors must be the same lengths
matlab在什么情况下出现Vectors must be the same lengths错误报告