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
give one word • pressure exerted by a stationary liquid _______. • force in a direction perpendicular to a given surface area __
mel-nik [20]

Answer:

1. Hydrostatic pressure.

2. Pressure.

3. Equilibrium forces.

Explanation:

1. <u>Hydrostatic pressure</u>: pressure exerted by a stationary liquid. It is simply the pressure in a liquid such as water at a specific depth.

Mathematically, hydrostatic pressure is given by the formula;

H.P = rho * g * d

Where:

  • H.P is the hydrostatic pressure of a liquid.
  • rho represents the density of a liquid.
  • g is the acceleration due to gravity.
  • d is the depth (height) of a liquid.

2. <u>Pressure</u>: it is the force in a direction perpendicular to a given surface area. Thus, it's typically measured in Newton per meters (N/m²).

Mathematically, pressure is given by the formula;

Pressure = \frac {Force}{area}

3. <u>Equilibrium forces</u>: a pair of forces whose resultant is zero. It is also referred to as balanced forces because the resultant of all the pair of forces acting on a body or system is at equilibrium (balanced).

6 0
2 years ago
"how do we store information in long term memory?"
Andru [333]

Answer:

By saving it in the hard drive.

Hope I helped!

8 0
3 years ago
Which of the following statements is not true? Question 16 options: a) SQL is the most popular query language used for interacti
lisov135 [29]

Answer:

The answer to this question is option "d".

Explanation:

In this question option d (A user fills out a form to construct a description of the data desired in a SQL search) is not true. Because SQL stands for Structured Query Language. This is a query language used to communicate with a database and a user fills the form. Which is not possible in the SQL. So the option d is not true.

4 0
2 years ago
Identifying what you will need to review takes place during?
marishachu [46]
It takes places during surveying.

For example, let's say you want to review your own produced game application software, and found out whether it satisfy your consumer or not

Before you conduct the survey, you have to identify what aspect you want to find out from your consumers , such as : Does it have any bug ? Is it challenging enough ? is the graphic good enough ? etc
7 0
3 years ago
Read 2 more answers
Your computer uses 4 bits to represent decimal numbers (0, 1, 2, 3 and so on) in binary. What is the SMALLEST number
lord [1]

Answer:

C

Explanation:

I believe this is because you cannot represent the number sixteen with only four binary bits. The highest you can go is 15.

8 0
3 years ago
Other questions:
  • In the U.S. highway numbering system, north-south routes have
    9·2 answers
  • The Internet of Things (IoT) is a concept with emphasis on machine-to-machine communications to describe a more complex system t
    10·1 answer
  • 2. Imagine you play a game of fetch with the dog. It takes the dog 60 seconds to run a total of 180 meters. What was the dog's a
    6·1 answer
  • What is a series of instructions or commands that a computer follows used to create software
    9·1 answer
  • Is a book considered technology?
    8·2 answers
  • The chief intellectual property officer (CIPO) is responsible for collecting, maintaining, and distributing the organization's k
    14·1 answer
  • Produce definition in computer
    9·2 answers
  • Choose the term that matches the action.
    5·2 answers
  • GMI = $4,666.67 Total Monthly Deductions $1,131.00 What is the Net Monthly Income (GMI - Total Monthly Deductions) =
    9·1 answer
  • How many voltage values can be represented with a 10-bit binary code?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!