two 3*3 matrix multiplication using for loop in matlab.
14 次查看(过去 30 天)
显示 更早的评论
hi ; i need the multiplication of two 3*3 matrix ([3,3]*[3,3]) using for loops. thanks.actually i am going to do matlab matrix multiplication code.We will take two matrices as an input from the user and perform matrices multiplication in matlab.This can be used for array multiplication in matlab.
4 个评论
Image Analyst
2021-9-23
@maede mandi, then I assume it must be your homework, correct? If so, we're not able to provide the full solution to you or else you'd get into trouble. In the meantime, try input() to ask the user to input matrices
回答(2 个)
Sulaymon Eshkabilov
2021-9-23
Maybe you want to perform elementwise mutliplication of two matrices, if so, :
A.*B
FOR or WHILE loop are not advised to use for matrix multiplication.
for ii = 1:3
for jj = 1:3
AB(ii,jj)= A(ii,jj)*B(ii,jj);
end
end
1 个评论
Jan
2021-9-23
编辑:Jan
2021-9-26
If you search in the net or in this forum, you find:
- https://www.mathworks.com/matlabcentral/answers/154803-how-to-multiply-matrices-using-for-loops
- https://www.mathworks.com/matlabcentral/answers/313631-how-to-multiply-two-matrices-with-nested-for-loops
- https://www.mathworks.com/matlabcentral/answers/305306-explicitly-multiplication-of-matrices-using-for-loops
2 个评论
Jan
2021-9-26
You find code with loops for matrix and elementwise multiplications already. So what exactly is not clear yet?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!