Jump to content

Matrix multiplication: Difference between revisions

→‎{{header|MATLAB}}: Matlab has built-in function for matrix multiplication, defining one is not neccessary.
(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:
 
=={{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}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.