matlab中 Error using ==> mtimes Inner matrix dimensions must agree.程序A=[3 8 5 1 2];B=[3 4 5 2 6];>> i=1:length(A);>> i=1:length(B);>> sum=sum(A(i)+A(i)*B(i))Error using ==> mtimesInner matrix dimensions must agree.

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/05 04:24:29
matlab中 Error using ==> mtimes Inner matrix dimensions must agree.程序A=[3 8 5 1 2];B=[3 4 5 2 6];>> i=1:length(A);>> i=1:length(B);>> sum=sum(A(i)+A(i)*B(i))Error using ==> mtimesInner matrix dimensions must agree.

matlab中 Error using ==> mtimes Inner matrix dimensions must agree.程序A=[3 8 5 1 2];B=[3 4 5 2 6];>> i=1:length(A);>> i=1:length(B);>> sum=sum(A(i)+A(i)*B(i))Error using ==> mtimesInner matrix dimensions must agree.
matlab中 Error using ==> mtimes Inner matrix dimensions must agree.
程序A=[3 8 5 1 2];
B=[3 4 5 2 6];
>> i=1:length(A);
>> i=1:length(B);
>> sum=sum(A(i)+A(i)*B(i))
Error using ==> mtimes
Inner matrix dimensions must agree.

matlab中 Error using ==> mtimes Inner matrix dimensions must agree.程序A=[3 8 5 1 2];B=[3 4 5 2 6];>> i=1:length(A);>> i=1:length(B);>> sum=sum(A(i)+A(i)*B(i))Error using ==> mtimesInner matrix dimensions must agree.
要点乘,而且逻辑上i不应该两次赋值
A=[3 8 5 1 2];
B=[3 4 5 2 6];
i=1:length(A);
j=1:length(B);
sum=sum(A(i)+A(i).*B(j))