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/12/25 03:28:45
matlab中Errorusing==>mtimesInnermatrixdimensionsmustagree.程序A=[38512];B=[34526];>>i=1:length(A);>>i=1

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))