Explanation :
As matrix capabilities of MATLAB are not allowed to be used, we
will first locate the member in result matrix being calculated, and
then for that member, we will do element wise multiplication of B
and A.
Suppose (1,1) element of resultant matrix is to be calculated, we
know that (1,1) will be element-wise multiplication of first row of
B and first column of A. So we will run loop where each member of
1st row of B is multiplied with corresponding element from 1st
column of A. For reference, look for loop controlled by variable k
in the below code. Location of resultant member is fixed by i and j
variable controlled loop.
MATLAB Code:
clear all
%Clearing preivious data
clc
%Clearing screen
A = [4 5; 1 2; 5 6];
B = [4 3 7; 1 2 6; 2 0 4];
%Defining Matrices
[Ra,Ca]=size(A);
[Rb,Cb]=size(B);
%Identifying rows and columns in A and B matrices
%First locating which member we are going to calculate
for i=1:Rb
for j=1:Ca
%Initiating the member in multiplication result matrix with 0
M(i,j) = 0;
%Doing one by one element multiplication
for k=1:Rb;
%Adding each new element's multiplication to member
M(i,j) = M(i,j)+ B(i,k)*A(k,j);
end
end
end
%Displaying results
disp('Resultant Matrix : ');
disp(M)
Output in Command Window:
1. (20pts) Write the MATLAB program to find the multiplication of [B][A] MATLAB's matrix operation capabilities.....
matlab progam A commonly used matrix operation in linea alpebrais matrix matrix multiplication. Write a script that reads a matrix M from the that this is different from the clement wise Squaring of the matrix ( M 2). To do this, follow these steps income che of them (M2) Note a. Read a 2x2 matrix from the user and store it in M. Make sure you let the user know what to input b. Print the dimensions of the matrix,...
1. (30 Points) Write a MATLAB program that displays "The multiplication of 10 multiplied by integers of 1 through 15. Display your result back to the user with 2 decimal places (yes, 2 decimal places). You must implement your code using a for loop. The result should have the following format: The multiplication of 10*1 =10.00 The multiplication of 10*2 =20.00 The multiplication of 10'3=30.00 The multiplication of 10*15=150.00 2. (35 Points) Write MATLAB code to prompt a user for...
Please the write code using Matlab 8. Write your own code to perform matrix multiplication. Recall that to multiply two matrices, the inner dimensions must be Every element in the resulting C matrix is obtained by: Your code must be a function file and it must check to see if matrix multiplication can be performed on the provided matrices. Test your code with the following matrices: 4 4 2 9 -3 A2 17
write a program to find matrix B and C multiplication using assembly on 8051 Initialization: ORG 400H MATRIXA: DB 4, 6, 8, 1, 3. 6, 9, 3, 2 ORG 410H MATRIXB: DB 2,4,7, 4, 5,7, 3, 1,1 ORG 420H MATRIXB: DB 1, 3, 4.8, 7, 5, 3,8,9 ORG 430H RESULTDB 0, 0, 0, 0, 0, 0, 0, 0, 0 ORG 440H SIGR: DB 0, 0, 0, 0,0, 0, 0, 0, 0 write a program to find matrix B and C...
Use MATLAB OR SCILAB TO PERFORM THE FOLLOWING MATRIX OPERATION Use MATLAB or Scilab to perform the following matrix operation 1 7 -2 3 10 91 5 -1 1) 2 51 13 7 -54 21 31 4 -15 2 9 6 18 -4 -2 31 Input: (copy and paste the MATLAB or Scilab command in the following box) Output: (copy and paste the output in the following box)
Write your own matlab code to perform matrix multiplication. Recall that to multiply two matrices, the inner dimensions must be the same. Write this as a function with input arguments the matrices to be multiplied and output argument the resultant matrix, use "assert" statement(s) to check that the input arguments are valid and print an error message if they are not. Test with A=[1,2,3;4,5,6] and B=[7,8;9,10;11,12] showing results for: (a) A*B, (b) B*A, and (c) A*A.
(Using MATLAB) Write a program using loops that will print the following multiplication table: 1 2 4 3 6 9 4 8 12 16 5 10 15 20 25
The assignment In this assignment you will take the Matrix addition and subtraction code and modify it to utilize the following 1. Looping user input with menus in an AskUserinput function a. User decides which operation to use (add, subtract) on MatrixA and MatrixB b. User decides what scalar to multiply MatrixC by c. User can complete more than one operation or cancel. Please select the matrix operation 1- Matrix Addition A+ B 2-Matrix Subtraction A-B 3Scalar Multiplication sC 4-Cancel...
Use MATLAB program to answer the following questions. Copy the MATLAB code and the results from running the code 6. Find the determinant and inverse of the following 4 x 4 matrix 3 5 -2 6 2-1 A=11 6. Find the determinant and inverse of the following 4 x 4 matrix 3 5 -2 6 2-1 A=11
Write a MATLAB program that loads two matrices A and B from the files hw41matA.txt andhw41matB.txt and multiplies them together to obtain matrix C such that the element C(i,j) ofmatrix C is given by: C(i, j) = ∑A(i, k) ∗ B(k, j) where n = number of columns in A = number of rows in B. Display the matrix C in defaultMATLAB format. You cannot use the MATLAB matrix multiply or other inbuilt MATLAB functions forarithmetic operations. You must implement it....