大家帮我看看这个程序为什么报错,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,wa

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 05:38:26

大家帮我看看这个程序为什么报错,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,wa
大家帮我看看这个程序为什么报错,
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.

大家帮我看看这个程序为什么报错,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,wa
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)
请采纳