![ineedhelp2285](/avatars/19188.jpg)
ineedhelp2285
22.04.2020 •
Computers and Technology
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 values 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).
Solved
Show answers
More tips
- T Travel and tourism Maldives Adventures: What is the Best Season to Visit the Luxurious Beaches?...
- H Health and Medicine Kinesiology: What is it and How Does it Work?...
- O Other How to Choose the Best Answer to Your Question on The Grand Question ?...
- L Leisure and Entertainment History of International Women s Day: When Did the Celebration of March 8th Begin?...
- S Style and Beauty Intimate Haircut: The Reasons, Popularity, and Risks...
- A Art and Culture When Will Eurovision 2011 Take Place?...
- S Style and Beauty How to Choose the Perfect Hair Straightener?...
- F Family and Home Why Having Pets at Home is Good for Your Health...
- H Health and Medicine How to perform artificial respiration?...
- H Health and Medicine 10 Tips for Avoiding Vitamin Deficiency...
Answers on questions: Computers and Technology
- C Computers and Technology Implement the build_dictionary() function to build a word frequency dictionary from a list of words....
- C Computers and Technology Jake has a collection of 40 movies on Blu-ray discs. How much space will he need to store them on a hard disk...
- C Computers and Technology You can not give an exact size for a height for column width true or false...
- C Computers and Technology Paragraph attributes are adjusted by clicking the button....
- C Computers and Technology Use the drop-down menus to identify the career cluster that fits each job description. Andrew is a Video Editor who edits television commercials: Veda is an Electrician who sets...
- C Computers and Technology Write a program that lets the user play the game Rock, Paper, Scissors against the computer. The program should:...
- M Mathematics What is the exact length of arc ab?...
- M Mathematics Explain how to use the figure below and a sequence of similarity transformations to prove that all circles are similar....
- M Mathematics An ant crawls at a rate of 2 1/6 ft per minute. at this rate, how long does it take the ant crawls a distance of 5 1/5 ft...
- M Mathematics In circle a shown below, marc bc is 71° and marc ef is 78°: points b, c, e, f lie on circle a. lines be and cf pass through point d creating angle edf. measure of arc bc is 71 degrees...
Ответ:
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.
Ответ: