matlab 编程问题function C = prob3u(A,B)2 [m, n] = size (A);3 [n1,p] = size (B);4 if n~=n1,5 error ( ’wrong sizes of A and B!’ );6 end7 C = zeros (m,p);8 for i = 1:m,9 for j = i:p,10 for k = i:j,11 C(i,j) = C(i,j) + A(i,k) * B(k,j);12 end13 en
来源:学生作业帮助网 编辑:作业帮 时间:2024/08/31 15:55:21
matlab 编程问题function C = prob3u(A,B)2 [m, n] = size (A);3 [n1,p] = size (B);4 if n~=n1,5 error ( ’wrong sizes of A and B!’ );6 end7 C = zeros (m,p);8 for i = 1:m,9 for j = i:p,10 for k = i:j,11 C(i,j) = C(i,j) + A(i,k) * B(k,j);12 end13 en
matlab 编程问题
function C = prob3u(A,B)
2 [m, n] = size (A);
3 [n1,p] = size (B);
4 if n~=n1,
5 error ( ’wrong sizes of A and B!’ );
6 end
7 C = zeros (m,p);
8 for i = 1:m,
9 for j = i:p,
10 for k = i:j,
11 C(i,j) = C(i,j) + A(i,k) * B(k,j);
12 end
13 end
14 end
是什么意思
matlab 编程问题function C = prob3u(A,B)2 [m, n] = size (A);3 [n1,p] = size (B);4 if n~=n1,5 error ( ’wrong sizes of A and B!’ );6 end7 C = zeros (m,p);8 for i = 1:m,9 for j = i:p,10 for k = i:j,11 C(i,j) = C(i,j) + A(i,k) * B(k,j);12 end13 en
粗略看了一下,好像就是实现矩阵乘法 C=A*B.
这可能是哪本书的习题的答案,从实用意义上说,毫无价值.
PS:每行开始的那些行号都要去掉.