作业帮 > 综合 > 作业

matlab中错误vectors must be the same lengths 是怎么回事?

来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/08/13 13:03:14
matlab中错误vectors must be the same lengths 是怎么回事?
t=[0.25 0.5 1 1.5 2 3 4 6 8];
c=[19.21 18.15 15.36 14.10 12.89 9.32 7.45 5.24 3.01];
subplot(1,1,1);plot(x,y,'o')
要对一组数据进行拟合,写了以上程序,报了Vectors must be the same lengths错误,
matlab中错误vectors must be the same lengths 是怎么回事?
x和y没有定义,plot(x,y,'o')改成plot(t,c,'o')即可,错误提示应该是x无定义,你给出的英文的意思是横纵坐标元素个数不一样,无法作图.
中国物联网校企联盟技术部