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
bogdanovich [222]
3 years ago
13

Consider the following arrays. 1 4 21 2 4 100 B # 111(A) L3π 42 Write MATLAB expressions to do the tollowing a. Select just the

second row of B. b. Evaluate the sum of the second row of B. c. Multiply the second column of B and the first column of A element by element. d. Evaluate the maximum value in the vector resulting from element-by- element multiplication of the second column of B with the first column of A. e. Use element-by-element division to divide the first row of A by the first three elements of the third column of B. Evaluate the sum of the elements of the resulting vector
Computers and Technology
1 answer:
andriy [413]3 years ago
6 0

Answer:

Complete Matalb code along with explanation and output results are given below

Explanation:

We are given following two matrices A and B of size 4x3

A = [1 4 2; 2 4 100; 7 9 7; 3 pi 42]

B = log(A)

(a) Select just the second row of B

% to extract any row use this syntax  B(row no, : )  we can also extract more than 1 row or any particular elements in a specific row

B_row_2 = B(2,:)

(b) Evaluate the sum of the second row of B

% simply use the sum function and pass it any vector or matrix and it will return their sum

sum_B_row_2 = sum( B_row_2(:) )  

(c) Multiply the second column of B and the first column of A element by element

% first we extract the column 2 of matrix B and column 1 of matrix A. use this syntax  B( : ,col no ) to extract any column  

B_col_2 = B(:,2)

A_col_1 = A(:,1)

% Then we use ( .*) to multiply element by element. To use standard multiplication of matrices only use asterisk sign without coma

multiply=B_col_2.*A_col_1

(d) Evaluate the maximum value in the vector resulting from element-by- element multiplication of the second column of B with the first column of A

% we can find the maximum value in a vector or matrix by using max function so we pass the multiply variable where our result was stored

max_value = max(multiply)

(e) Use element-by-element division to divide the first row of A by the first three elements of the third column of B. Evaluate the sum of the elements of the resulting vector

%  First we extract the row 1 of matrix A

A_row_1 = A(1,:)

%  Then we extract the column 3 of matrix B

B_col_3 = B(:,3)

%  Then we extract the first 3 elements of column 3 of matrix B

B_col_3 = B_col_3(1:3)

% Finally we use ( ./ ) to use element by element division

divide = A_row_1./B_col_3

% Using the sum function again results in the addition of entire elements of resultant matrix

sum_divide = sum( divide(:) )

Only Code:

A = [1 4 2; 2 4 100; 7 9 7; 3 pi 42]

B = log(A)

B_row_2 = B(2,:)

sum_B_row_2 = sum( B_row_2(:) )  

B_col_2 = B(:,2)

A_col_1 = A(:,1)

multiply=B_col_2.*A_col_1

max_value = max(multiply)

A_row_1 = A(1,:)

B_col_3 = B(:,3)

B_col_3 = B_col_3(1:3)

divide = A_row_1./B_col_3

sum_divide = sum( divide(:) )

Output Results:

A =

    1.0000     4.0000     2.0000

    2.0000     4.0000   100.0000

    7.0000     9.0000     7.0000

    3.0000     3.1416    42.0000

B =  

  0.00000   1.38629   0.69315

  0.69315   1.38629   4.60517

  1.94591   2.19722   1.94591

  1.09861   1.14473   3.73767

B_row_2 =   0.69315   1.38629   4.60517

sum_B_row_2 =  6.6846

B_col_2 =  

  1.3863

  1.3863

  2.1972

  1.1447

A_col_1 =

  1

  2

  7

  3

multiply =

   1.3863

   2.7726

  15.3806

   3.4342

max_value =  15.381

A_row_1 =     1   4   2

B_col_3 =  

  0.69315

  4.60517

  1.94591

  3.73767

B_col_3 =

  0.69315

  4.60517

  1.94591

divide =

  1.44270   5.77078   2.88539

  0.21715   0.86859   0.43429

  0.51390   2.05559   1.02780

sum_divide =  15.216

You might be interested in
Hello, please help write code in C++. Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go nort
krok68 [10]

Answer:

Please Find attached  c++ code file.

Explanation:

  1. Ask User to enter highway number.
  2. Check if highway is primary or auxiliary.
  3. Check if highway number is even / odd.
  4. Find Primary high number for an auxiliary highway

Check if highway is primary or auxiliary.

Use if condition to check if the entered number is in between 0 and 99.If it's true than the highway is primary otherwise it's an auxiliary highway.

Check if highway number is even / odd.

To check if a number is even or odd we use simple modulo formula. In mathematics modulo returns the reminder of a division operation on two numbers.If modulo of a number and 2 is equal to zero than that number is an even number other wise its an odd number.

(Any number ) mod 2 = 0

Find Primary high number for an auxiliary highway

As mentioned in the question last two digits of highway number is the number of primary high.

To Find last two digits of number apply modulo operation on highway number and 100. it will provide last two digits of number specifying our primary highway.

Download cpp
3 0
4 years ago
Which describes the "Network Effect?
KIM [24]

Answer:

phenomenon

Explanation:

Increased numbers of people or participants improve the value of a good or service.

3 0
3 years ago
Extended essay on globalization not less than 200​
Serggg [28]

Answer:

First of all, people have been trading goods since civilization began. In the 1st century BC, there was the transportation of goods from China to Europe. The goods transportation took place along the Silk Road. The Silk Road route was very long in distance. This was a remarkable development in the history of Globalization. This is because, for the first time ever, goods were sold across continents.

Globalization kept on growing gradually since 1st BC. Another significant development took place in the 7th century AD. This was the time when the religion of Islam spread. Most noteworthy, Arab merchants led to a rapid expansion of international trade. By the 9th century, there was the domination of Muslim traders on international trade. Furthermore, the focus of trade at this time was spices.

True Global trade began in the Age of Discovery in the 15th century. The Eastern and Western continents were connected by European merchants. There was the discovery of America in this period. Consequently, global trade reached America from Europe.

From the 19th century, there was a domination of Great Britain all over the world. There was a rapid spread of international trade. The British developed powerful ships and trains. Consequently, the speed of transportation greatly increased. The rate of production of goods also significantly increased. Communication also got faster which was better for Global trade.

Finally, in 20th and 21st -Century Globalization took its ultimate form. Above all, the development of technology and the internet took place. This was a massive aid for Globalization. Hence, E-commerce plays a huge role in Globalization.

5 0
3 years ago
I need some good roblox games suggestions. Since brainly only lets two answer, please answer in the commments. :)
3241004551 [841]

Answer: Phantom Forces... I think that is what it is called...

4 0
3 years ago
Read 2 more answers
_____ is a technical career skill.
kifflom [539]
Time management is a very crucial skill to have because taking to long would set you back a long way.
7 0
3 years ago
Read 2 more answers
Other questions:
  • • Two advertisers A and B
    8·1 answer
  • What layer uses the UDP protocol
    6·1 answer
  • Can someone come and see if I have answered this question correctly? Please ...
    10·2 answers
  • ____ is an approach to boundary spanning which results from using sophisticated software to search through large amounts of inte
    5·1 answer
  • If the executives for Office Max LLC, a chain of office supply stores, developed the chain's objectives by asking buyers and sto
    11·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    15·2 answers
  • a pair of shoes is on sale for 15% off with this discount customers will pay $9 if they buy the shoes ​
    14·1 answer
  • Awnser pls I will appreciate it
    9·1 answer
  • For what purpose power point is used?​
    5·2 answers
  • List out any four hardware and software components required for multimedia​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!