B=[0.02,-0.01,0;-0.01,0.02,-0.01;0,-0.01,0.01];
x(2)=[1;2;3] ;
B*x(2)
??? In an assignment A(I) = B, the number of elements in B and
I must be the same.
错误还是这样的,矩阵的乘法这里用的没有问题啊一个是3*3矩阵,一个是3*1矩阵,都没有问题啊
B=[0.02,-0.01,0;-0.01,0.02,-0.01;0,-0.01,0.01];
x(2)=[1;2;3] ;
B*x(2)
??? In an assignment A(I) = B, the number of elements in B and
I must be the same.
错误还是这样的,矩阵的乘法这里用的 ...
x(2) 是一个数,不能赋值为一个向量!
要不用cell,即 x{2} = [1;2;3],不过用在你这里不妥;要不 x = [1;2;3],这样 B 就可以与 x 相乘了