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
Liono4ka [1.6K]
4 years ago
12

g Given a 5 by 5 matrix of all positive values, write a program to find and display the greatest product of the 2 adjacent value

s in the vertical direction. For example, in the matrix below the greatest product of 2 adjacent values in vertical direction is 64 which is a product of mat(1,3) and mat(2,3).

Computers and Technology
1 answer:
Rom4ik [11]4 years ago
7 0

Answer:

Check the explanation

Explanation:

% iterate through each column (outer loop) , then iterate rows-1 (inner loop)

%take product of adjacent rows

mat = input('enter 5 by 5 matrix : ');

[R,C] = size(mat);

max_prod =0;

for c =[1:C]

for r=[1:(R-1)]

temp = mat(r,c)*mat((r+1),c);

if max_prod<temp

max_prod=temp;

end

end

end

fprintf('Greatest product : %i\n', max_prod)

Kindly check the output in the attached image below.

You might be interested in
___________ colors come forward and command attention. ______________ colors recede away from our eyes and tend to fall into the
aliya0001 [1]

Answer:

"Warm; Cool/receding" is the correct answer.

Explanation:

  • The color temperature would be referred to as summer and winter upon that color wheel, the hottest becoming red/orange as well as the most cooler always being bluish or greenish.
  • A terminology to define the warmth of the color is termed as Warm colors. Warm hues are prominent as well as lively just like reds, oranges, etc.

Thus the above is the right answer.

4 0
3 years ago
Python coding beginners question
Llana [10]

Answer:

i really don't know

4 0
3 years ago
Read 2 more answers
Print("Weight on Earth?")
Lynna [10]

Answer:

weightEarth = float(input("Enter weight on earth: "))

weightMoon = weightEarth/6

print("Weight on moon:", weightMoon)

Explanation:

You have to convert the string input into a float in order to do calculations with it.

5 0
3 years ago
Why do computers need RAM and ROM?<br>Please explain simply. :)
amm1812
RAM stands for Random Access Memory
ROM stands for Read Only Memory

Computers need RAM because RAM is the place in the computers, where the operating system, application programs, and data (in current use) are stored that way the computers processor can easily reach it. ROM is memory that can not be changed by a program or the user. ROM has its memory even after it is turned off. ROM is an example of telling your computer how to start up.

Sorry that was kinda long. Hope this helps you out! Have an AWESOME rest of your day!
3 0
3 years ago
Please help with this coding question
snow_tiger [21]
Answer: the variable called errors is tested to see if it is less than it equal to 4
8 0
3 years ago
Read 2 more answers
Other questions:
  • Laura would like to include additional text that is related to the document but not contained within the document.
    13·2 answers
  • ICS encourages jurisdictions to use common terminology. Common terminology:
    10·1 answer
  • Which of the selections below does not represent a workable ip address?
    8·1 answer
  • Dose the internet bring people together?
    15·1 answer
  • Select the correct answer from each drop-down menu
    6·2 answers
  • Tim is creating a page to display his poker club’s set of rules. He has main categories and subcategories along with about a par
    12·1 answer
  • What is the unit of information called when a network adapter adds the source and destination mac address to the segment of data
    15·1 answer
  • What is the difference between a Yahoo! and Yippy!?\
    12·1 answer
  • You're as smooth as Tennessee whiskey
    8·2 answers
  • Understanding that protection of sensitive unclassified information is:
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!