Question

Below is a matrix of random numbers. Find the mean, median, and mode of the matrix. B=[0 1 2 3 4 50 689 23092 68 40 7] Sort M

How do I solve using Matlab?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

B=[0 1 2 3 4;5 0 6 8 9;2 3 0 9 2;6 8 4 0 7];
mean_B=mean(mean(B));
median_B=median(median(B));
B=[flip(sort(B(1,:)));flip(sort(B(2,:)));flip(sort(B(3,:)));flip(sort(B(1,:)))];
fprintf("Mean of matrix B is: %f\n",mean_B);
fprintf("Meadian of matrix B is: %f\n",median_B);
disp("Sorted matrix is:\n");
disp(B);

C:\Octave\OCTAVE-1.0\mingw64\bin\octave-gui.exe octave:43> B=[0 1 2 3 4;5 0 6 8 9;2 3 0 9 2;6 8 4 0 7]; octave:44> mean_B=mea

Add a comment
Know the answer?
Add Answer to:
How do I solve using Matlab? Below is a matrix of random numbers. Find the mean,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • MATLAB QUESTION !!! PLEASE USE MATLAB FOR BOTH QUESTIONS!!! THANKS 3) Below is a matrix of...

    MATLAB QUESTION !!! PLEASE USE MATLAB FOR BOTH QUESTIONS!!! THANKS 3) Below is a matrix of random numbers. Find the mean, median, and mode of the matrix. B=[0 1 2 3 4 50689 23092 6 8 407] Sort Matrix Z so that the largest numbers of each row are in the first column and smallest numbers descend towards the last column. Must use sort function. 4) Create a matrix X so that the first row has values from 0 to...

  • How do I solve using Matlab? Create a matrix X so that the first row has...

    How do I solve using Matlab? Create a matrix X so that the first row has values from 0 to 50 (default intervals), and the second row has values from 50 to 100. Let matrix Y equal to x10 and Z equal to x + y2 Create 4 subplots containing a mesh, surface, 3-Dimensional, and a surface-contour plot. Label with appropriate titles and labels. The plots should have a string look to them.

  • Java 1. Create a 1D array of 4096 Unique random integer numbers of 1 to 5...

    Java 1. Create a 1D array of 4096 Unique random integer numbers of 1 to 5 digits. Of those numbers give me the following information: - Mean , Mode, Median, Range. - Five times, ask the user for a number within the range (from above) and record the time to find the number in the range. (Loop count) 2. Using a any sort algorithm, build sorted 2D array of random numbers (1 TO 5 digits ) with the x direction...

  • 2. (10 pts. Please perform the following calculations via MATLAB a. Calculate e3!/pi and round the...

    2. (10 pts. Please perform the following calculations via MATLAB a. Calculate e3!/pi and round the answer to the nearest integer (all via MATLAB commands) b. Calculate cos(wt) for t (time) from 0 seconds to 10 seconds (with 1 second increments – created via colon operator) where w = 30°/seconds c. Please sort the values of the vector given below from smallest to largest and save it as another single column vector and G = [68, 83,61, 70, 75, 82,57,5,...

  • matlab( answer the question in matlab) show the full answer with comment please. W a rnction...

    matlab( answer the question in matlab) show the full answer with comment please. W a rnction to find the largest product of adjacent number pairs in a matrix, where pair combinations can be selected the horsonal accent or vertically adjacent (but not diagonally adjacent) of numbers in a matrix are accent if they are in the same row or column and located next to each other when the 2D matrix is displayed The largest product of a pair of adjacent...

  • Using RStudio, Create an R-Script: (1) You will generate a numeric matrix of size 21 by...

    Using RStudio, Create an R-Script: (1) You will generate a numeric matrix of size 21 by 21 and will name it tmp. To do so, draw 21×21 = 441 random observations from the standard normal distribution. Before doing so, set the seed for the random number generator to 37. See help for set.seed(). (2) Change the diagonal elements of tmp to 1s. (3) Calculate condition number of tmp. See help for cond(). (4) Calculate the inverse of tmp. See help...

  • Using RStudio, Create an R-Script: (1) You will generate a numeric matrix of size 21 by...

    Using RStudio, Create an R-Script: (1) You will generate a numeric matrix of size 21 by 21 and will name it tmp. To do so, draw 21×21 = 441 random observations from the standard normal distribution. Before doing so, set the seed for the random number generator to 37. See help for set.seed(). (2) Change the diagonal elements of tmp to 1s. (3) Calculate condition number of tmp. See help for cond(). (4) Calculate the inverse of tmp. See help...

  • Find the mean, median, and mode for each set of numbers. (If necessary, round your answers...

    Find the mean, median, and mode for each set of numbers. (If necessary, round your answers to one decimal place. If an answer does not exist, enter DNE.) (a)    69, 68, 55, 69, 54, 51, 64, 57, 69 mean     median     mode     (b)    75, 49, 56, 35, 49, 33, 76, 70, 48 mean     median     mode     2. he scatter plot shows how long it took different numbers of workers to do the same job. (a) How many hours did it take the crew of...

  • //please help I can’t figure out how to print and can’t get the random numbers to...

    //please help I can’t figure out how to print and can’t get the random numbers to print. Please help, I have the prompt attached. Thanks import java.util.*; public class Test { /** Main method */ public static void main(String[] args) { double[][] matrix = getMatrix(); // Display the sum of each column for (int col = 0; col < matrix[0].length; col++) { System.out.println( "Sum " + col + " is " + sumColumn(matrix, col)); } } /** getMatrix initializes an...

  • Need help on this Matlab problem, I do not know how to do it Problem 2....

    Need help on this Matlab problem, I do not know how to do it Problem 2. (2D Sorting) The following table contains the scores for the 4 students A,B.C and D for four Homeworks HW1 50 20 85 65 HW2HW 45 80 30 95 HW4 75 35 15 80 Student A Student B Student C Student D 40 60 100 a) Create a matrix with the above data b) What is the minimum score of all four homework? (use the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT