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
After clicking the Start button on your computer screen desktop, what option would you then select to examine system components
Sveta_85 [38]
You can find the components that you wanted to modify in : C. control panel

You can adjust your computer's setting through control panel, whether it's your system and security, hardware, net work setting, etc

hope this helps
4 0
3 years ago
Read 2 more answers
Describe a sub routine​
Maksim231197 [3]

Explanation:

A routine or subroutine, also referred to as a function procedure and sub program is code called and executed anywhere in a program. FOr example a routine may be used to save a file or display the time.

4 0
2 years ago
What is log in and log out?
Brums [2.3K]
Log in is the feature that allows you to access your electronic account in a website, database or other, also a bank account. Your username and password are stored in cookies  (files that websites use and are stored in your browser) for the session. This is true if we talk about websites.

When you're done, you log out from your account, you disconnect. Cookies are cleared (for websites) and you're out.
8 0
3 years ago
David is working in a database that organizes student exam grade information. He needs to find all students who have scored 100
kobusy [5.1K]

Answer:

David can apply filter to the data in order to show only records that meet the criteria.

Explanation:

  • Filter is a very helpful option that displays the records that you want to view, hiding rest of the unwanted records.
  • Sometimes you want to extract and view only the records that match a specific criteria instead of viewing all the records.
  • For example in the CUSTOMERS table which contains names, addresses, countries of customers. There are several customers from different countries but you only want to view the customers from Spain. So you can use filter feature to view all the customers from country Spain.
  • In MS Access you can apply filters using Sort & Filter group in the Home tab by selecting the desired column. In SQL, WHERE clause can be used along with SELECT to for filtering and extracting certain records. SELECT will select the records from the table and WHERE clause will specify the criteria to select the certain records.
7 0
3 years ago
How to delete a brainly account?
dmitriy555 [2]

Answer:

Fill the deletion form go to settings and open FAQ ..

7 0
3 years ago
Read 2 more answers
Other questions:
  • Is microsoft word the same as microsoft office?
    12·2 answers
  • Your friend, who is a little computer phobic, is going to create his first web page, and he asks you to recommend some software
    13·1 answer
  • Contains the instructions your computer or device needs to run programs and apps
    5·1 answer
  • one data is in memory the computer interpets and executeinstructions to process the data into informationA. TrueB. False
    8·1 answer
  • Consider a multidimensional array A stored in row-major order with 22 rows and 6 columns whose subscripts start at 0. If each el
    8·1 answer
  • Mrs. Zoo gave out the rubric for our essay. She stated that our essay should be complete by Friday of that week. I didn't have t
    13·1 answer
  • A single-user/single-tasking operating system allows only one user to perform one task at a time. A real-time operating system g
    13·1 answer
  • Arrange these steps of creating a presentation in the correct order. (notice that the given order is incorrect other than the ba
    13·1 answer
  • Your development team is planning to host a development environment on the cloud. This consists of EC2 and RDS instances. This e
    13·1 answer
  • The FCFS algorithm is particularly troublesome for ____________.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!