1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
mina [271]
3 years ago
8

Write a function M-file that takes as input two matrices A and B, and as output produces

Computers and Technology
1 answer:
s344n2d4d5 [400]3 years ago
4 0

Answer:

Explanation:

The Matlab Function rowproduct.m

function C = rowproduct( A,B) % The function rowproduct.m

M = size(A); % Getting the dimension of matrix A

N = size(B); % Getting the dimension of matrix B

if(M(2)~=N(1)) % Checking the dimension

fprintf('Error in matrix dimension\n'); % print error if dimension mismatch

return; % And end the further execution of function

end % End of if condition

C = []; % initilizing the result matrix C

for k = 1:M(1) % Loop to perform the row product

C = [C;A(k,:)*B];% Computing row product and updating matrix C

end % End of loop

end % End of function

Testing the function rowproduct.m

The 2x3, 3x2 Matrix:

>> A = [ 1 2 3; 1 2 3];

>> B = [1 2; 1 2; 1 2];

>> C = rowproduct(A,B)

C =

6 12

6 12

>> A*B

ans =

6 12

6 12

The 3x4, 4x2 matrix:

>> A = [ 1 2 3 4; 1 2 3 4; 1 2 3 4];

>> B = [1 2; 1 2; 1 2; 1 2];

>> C = rowproduct(A,B)

C =

10 20

10 20

10 20

>> A*B

ans =

10 20

10 20

10 20

The 3x4 and 2x4 matrix:

>> A = [ 1 2 3 4; 1 2 3 4; 1 2 3 4];

>> B = [1 2 1 2; 1 2 1 2];

>> rowproduct(A,B)

Error in matrix dimension

You might be interested in
When did internet came to existence?
Luden [163]
1982 the Internet protocol was introduced as the standard network protocol on the ARPANET.

1981 access to the ARPANET was expanded.
7 0
3 years ago
What is performance? Multiple Choice measures how quickly a system performs a process or transaction a system that is not operat
Lilit [14]

Answer: measures how quickly a system performs a process or transaction

Explanation:

Computer performance refers to how well a given computer system performs, which is estimated by its accuracy, efficiency and speed when completing a process or transaction.

A computer performance evaluation will assess a system's resources and outputs to make sure that it´s performing in the best possible way.

Some parameters of performance are latency, speed, throughput, and bandwidth.

8 0
3 years ago
Read 2 more answers
Which type of chart is used to chart progress over time?
Morgarella [4.7K]

Answer: Timeline

Explanation:

6 0
3 years ago
Amy uses digital devices to listen to music and to watch movies. Which one of these is Mbps a measure of?
posledela

Answer:

Storage Size

Explanation:

the answer to which is better 8 Mbps or 2 MBps? Is 2 MBps (which is 16 Mbps). Using a less common, but more clear notation: which is better 8 Mbit/s or 2 MBps? Answer: 2 MBps, since that is 16 Mbit/s. (Marketing people use this confusion to their advantage if you're not sure which is intended, ask.)

Source http://cs.sru.edu/~mullins/cpsc100book/module02_introduction/module02-05_introduction.html

(if you want to read the full artical.)

8 0
2 years ago
SOMEONE HELP PLEASE ​
exis [7]
Do what?? please tell me
3 0
2 years ago
Other questions:
  • What is the most credible website or webpage you have ever visited?Why is it so credible? Describe some of the qualities that ma
    11·1 answer
  • Binary code what does this mean I was sick so I don't under stand
    7·2 answers
  • What type of firewall works on the Session layer that creates a connection and allows packets to flow between the two hosts with
    8·1 answer
  • Which is the last step in conducting a URL search?
    5·2 answers
  • Microsoft Windows is the least used operating system. TRUE or FALSE.
    13·1 answer
  • 7) Which of the following factors determines the structure, features, and functions of an information system used in a company?
    7·1 answer
  • Write a program to display the roll number of students who have scored 100 in math. display appropriate message if none have sco
    5·1 answer
  • Which of the following keywords is used to remove a row in a table? (Points : 2) DROP
    11·1 answer
  • Why would a programmer use a flow chart? (Edge2020 Coding Critical Thinking Questions)
    9·1 answer
  • Select the correct answer from each drop-down menu. A company is recruiting for a web designer. What kind of candidate should th
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!