作业帮 > 综合 > 作业

大家帮我看看这个程序为什么报错,

来源:学生作业帮 编辑:灵鹊做题网作业帮 分类:综合作业 时间:2024/05/03 18:40:56
大家帮我看看这个程序为什么报错,
years=1950:10:1990;
service=10:10:30;
T=zeros(21,41);
wage = [150.697 199.592 187.625 179.323 195.072 250.287 203.212 179.092 322.767 226.505 153.706 426.730 249.633 120.281 598.243];
interp2(service,years,wage,15,1975);
报告是Error using ==> interp2 at 147
X and Y must be same length as Z or the lengths
of X and Y must match the size of Z.
大家帮我看看这个程序为什么报错,
service的长度为3
years的长度为5
wage就得是5×3的二维数组
像这样改改就好了
years=1950:10:1990;
service=10:10:30;
T=zeros(21,41);
wage = [150.697 199.592 187.625;
179.323 195.072 250.287;
203.212 179.092 322.767;
226.505 153.706 426.730;
249.633 120.281 598.243];
interp2(service,years,wage,15,1975)
请采纳