Question: Using MATLAB PLEASE! Task #1: Generate a 3 x 5 matrix (3 rows, 5 columns) with random values between 0 and 1 using the rand

Using MATLAB PLEASE!

Task #1:

Generate a 3 x 5 matrix (3 rows, 5 columns) with random values between 0 and 1 using the rand function. Name this realMat.

% Add code for task here

Task #2:

Generate a 2 x 5 matrix (2 rows, 5 columns) with random whole numbers between 1 and 15 using the randi function. Name this intMat.

% Add code for task here

Task #3:

Save the last column of realMat to a new vector called lastCol.

% Add code for task here

Task #4:

Save the first row of intMat to a new vector called firstRow.

% Add code for task here

Task #5:

Use the max function to generate a row-vector which holds the maximum value of each column in realMat. Save this to the variable name maxReals.

% Add code for task here

Task #6:

Use the min function to generate a row-vector which holds the minimum value of each column in intMat. Save this to the variable name minInt.

% Add code for task here

Task #7:

Generate a matrix with three rows called combo. Each row should have 5 elements and be generated as follows:

  • row 1: [ 7 4 7 3 2 ]
  • row 2: linspace( 8, 10, 5)
  • row 3: 3:7

% Add code for task here

Task #8:

Use the prod function to generate a row-vector which holds the product of each column in combo. Save this to the variable name prodVector.

% Add code for task here

Task #9:

Using scalar multiplication, multiply every element in combo by 3 and save to the variable name combo3.

% Add code for task here

Task #10:

Using element-wise multiplication, multiply every element in combo by combo3. Save to the variable task10Mat.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!