matlab新手问题h=0.1;t=0:h:1;N=length(t);y=ones(1,N);for k=2:N;y(1,k)=y(1,k-1)+h*(y(1,k-1)-2.*t/y(1,k-1))end问题是Subscripted assignment dimension mismatch.
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/08 18:38:37
matlab新手问题h=0.1;t=0:h:1;N=length(t);y=ones(1,N);fork=2:N;y(1,k)=y(1,k-1)+h*(y(1,k-1)-2.*t/y(1,k-1))e
matlab新手问题h=0.1;t=0:h:1;N=length(t);y=ones(1,N);for k=2:N;y(1,k)=y(1,k-1)+h*(y(1,k-1)-2.*t/y(1,k-1))end问题是Subscripted assignment dimension mismatch.
matlab新手问题
h=0.1;
t=0:h:1;
N=length(t);
y=ones(1,N);
for k=2:N;
y(1,k)=y(1,k-1)+h*(y(1,k-1)-2.*t/y(1,k-1))
end
问题是Subscripted assignment dimension mismatch.
matlab新手问题h=0.1;t=0:h:1;N=length(t);y=ones(1,N);for k=2:N;y(1,k)=y(1,k-1)+h*(y(1,k-1)-2.*t/y(1,k-1))end问题是Subscripted assignment dimension mismatch.
y(1,k)=y(1,k-1)+h*(y(1,k-1)-2.*t/y(1,k-1))
这句话的问题
数组维度不匹配.
等号左边是一个标量,右边计算得到的是一个1*11的向量.