Matrix multiplication: Difference between revisions
Content added Content deleted
(multiply routine in Icon/Unicon without library) |
(→{{header|MATLAB}}: Matlab has built-in function for matrix multiplication, defining one is not neccessary.) |
||
Line 1,329: | Line 1,329: | ||
=={{header|MATLAB}}== |
=={{header|MATLAB}}== |
||
Matlab contains two methods of multiplying matrices: by using the "mtimes(matrix,matrix)" function, or the "*" operator. |
|||
<lang Matlab>function [output] = matrixmultiplication(matrixA, matrixB) |
|||
output = matrixA*matrixB;</lang> |
|||
<lang MATLAB>>> A = [1 2;3 4] |
|||
A = |
|||
1 2 |
|||
3 4 |
|||
>> B = [5 6;7 8] |
|||
B = |
|||
5 6 |
|||
7 8 |
|||
>> A * B |
|||
ans = |
|||
19 22 |
|||
43 50 |
|||
>> mtimes(A,B) |
|||
ans = |
|||
19 22 |
|||
43 50</lang> |
|||
=={{header|Nial}}== |
=={{header|Nial}}== |