Matlab, Fourth Edition: A Practical Introduction to Programming and Problem Solving
Matlab, Fourth Edition: A Practical Introduction to Programming and Problem Solving
4th Edition
ISBN: 9780128045251
Author: Stormy Attaway Ph.D. Boston University
Publisher: Elsevier Science
bartleby

Videos

Question
Book Icon
Chapter 2, Problem 36E
To determine

To create:

• A 3×5 matrix, and find the maximum value in each column.

• A 3×5 matrix, and find the maximum value in each row.

• A 3×5 matrix, and find the maximum value in the entire matrix.

• A 3×5 matrix, and find the cumulative maxima.

Expert Solution & Answer
Check Mark

Answer to Problem 36E

Solution:

• A 3×5 matrix is mat=[531084575792410410]. And the maximum value in each column is 5, 4, -5, 7, and 9 respectively.

• A 3×5 matrix is mat=[4399151181059613]. And the maximum value in each row is 9, 5, and 6 respectively.

• A 3×5 matrix is mat=[715566731942497]. And the maximum value in the entire matrix is 9.

• A 3×5 matrix is mat=[158739727078132]. And the cumulative maxima are 9, 4, -6, 3 and 12 respectively.

Explanation of Solution

• A 3×5 matrix, and find the maximum value in each column.

MATLAB Code:

clc

clear all

close all

mat = randi([-10, 10], 3, 5)

% Define the command to generate a random numbers.

max(mat)

% Define the command to find the maximum value in each column.

Save the MATLAB script with name, chapter2_54793_2_39_1E.m in the current folder. Execute the script by typing the script name at the command window to create a 3×5 matrix. And find the maximum value in each column.

Result:

Matlab, Fourth Edition: A Practical Introduction to Programming and Problem Solving, Chapter 2, Problem 36E , additional homework tip  1

Therefore, a 3×5 matrix is mat=[531084575792410410]. And the maximum value in each column is 5, 4, -5, 7, and 9 respectively.

• A 3×5 matrix, and find the maximum value in each row.

MATLAB Code:

clc

clear all

close all

mat = randi([-10, 10], 3, 5)

% Define the command to generate a random numbers.

max(mat')

% Define the command to find the maximum value in each row.

Save the MATLAB script with name, chapter2_54793_2_39_2E.m in the current folder. Execute the script by typing the script name at the command window to create a 3×5 matrix. And find the maximum value in each row.

Result:

Matlab, Fourth Edition: A Practical Introduction to Programming and Problem Solving, Chapter 2, Problem 36E , additional homework tip  2

Therefore, a 3×5 matrix is mat=[4399151181059613]. And the maximum value in each row is 9, 5, and 6 respectively.

• A 3×5 matrix, and find the maximum value in the entire matrix.

MATLAB Code:

clc

clear all

close all

mat = randi([-10, 10], 3, 5)

% Define the command to generate a random numbers.

max(max(mat))

% Define the command to find the maximum value in the entire matrix.

Save the MATLAB script with name, chapter2_54793_2_39_3E.m in the current folder. Execute the script by typing the script name at the command window to create a 3×5 matrix. And find the maximum value in the entire matrix.

Result:

Matlab, Fourth Edition: A Practical Introduction to Programming and Problem Solving, Chapter 2, Problem 36E , additional homework tip  3

Therefore, a 3×5 matrix is mat=[715566731942497]. And the maximum value in the entire matrix is 9.

• A 3×5 matrix, and find the cumulative maxima.

MATLAB Code:

clc

clear all

close all

mat = randi([-10, 10], 3, 5)

% Define the command to generate a random numbers.

cumsum(mat)

% Define the command to create the cumulative matrix variable.

max(cumsum(vec))

% Define the command to select the smallest value.

Save the MATLAB script with name, chapter2_54793_2_39_4E.m in the current folder. Execute the script by typing the script name at the command window to create a 3×5 matrix. And find the maximum value in the entire matrix.

Result:

Matlab, Fourth Edition: A Practical Introduction to Programming and Problem Solving, Chapter 2, Problem 36E , additional homework tip  4

Therefore, a 3×5 matrix is mat=[158739727078132]. And the cumulative maxima are 9, 4, -6, 3 and 12 respectively.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
PEER REPLY 1: Choose a classmate's Main Post and review their decision making process. 1. Choose a risk level for each of the states of nature (assign a probability value to each). 2. Explain why each risk level is chosen. 3. Which alternative do you believe would be the best based on the maximum EMV? 4. Do you feel determining the expected value with perfect information (EVWPI) is worthwhile in this situation? Why or why not?
Questions An insurance company's cumulative incurred claims for the last 5 accident years are given in the following table: Development Year Accident Year 0 2018 1 2 3 4 245 267 274 289 292 2019 255 276 288 294 2020 265 283 292 2021 263 278 2022 271 It can be assumed that claims are fully run off after 4 years. The premiums received for each year are: Accident Year Premium 2018 306 2019 312 2020 318 2021 326 2022 330 You do not need to make any allowance for inflation. 1. (a) Calculate the reserve at the end of 2022 using the basic chain ladder method. (b) Calculate the reserve at the end of 2022 using the Bornhuetter-Ferguson method. 2. Comment on the differences in the reserves produced by the methods in Part 1.
You are provided with data that includes all 50 states of the United States. Your task is to draw a sample of: o 20 States using Random Sampling (2 points: 1 for random number generation; 1 for random sample) o 10 States using Systematic Sampling (4 points: 1 for random numbers generation; 1 for random sample different from the previous answer; 1 for correct K value calculation table; 1 for correct sample drawn by using systematic sampling) (For systematic sampling, do not use the original data directly. Instead, first randomize the data, and then use the randomized dataset to draw your sample. Furthermore, do not use the random list previously generated, instead, generate a new random sample for this part. For more details, please see the snapshot provided at the end.) Upload a Microsoft Excel file with two separate sheets. One sheet provides random sampling while the other provides systematic sampling. Excel snapshots that can help you in organizing columns are provided on the next…
Knowledge Booster
Background pattern image
Statistics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, statistics and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
College Algebra (MindTap Course List)
Algebra
ISBN:9781305652231
Author:R. David Gustafson, Jeff Hughes
Publisher:Cengage Learning
Text book image
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:9781133382119
Author:Swokowski
Publisher:Cengage
Text book image
College Algebra
Algebra
ISBN:9781305115545
Author:James Stewart, Lothar Redlin, Saleem Watson
Publisher:Cengage Learning
Text book image
Intermediate Algebra
Algebra
ISBN:9780998625720
Author:Lynn Marecek
Publisher:OpenStax College
Text book image
Algebra: Structure And Method, Book 1
Algebra
ISBN:9780395977224
Author:Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:McDougal Littell
Finite Math: Markov Chain Example - The Gambler's Ruin; Author: Brandon Foltz;https://www.youtube.com/watch?v=afIhgiHVnj0;License: Standard YouTube License, CC-BY
Introduction: MARKOV PROCESS And MARKOV CHAINS // Short Lecture // Linear Algebra; Author: AfterMath;https://www.youtube.com/watch?v=qK-PUTuUSpw;License: Standard Youtube License
Stochastic process and Markov Chain Model | Transition Probability Matrix (TPM); Author: Dr. Harish Garg;https://www.youtube.com/watch?v=sb4jo4P4ZLI;License: Standard YouTube License, CC-BY