Question

Create a matrix 4x4 of integer random numbers between 1 and 50, and perform the following...

Create a matrix 4x4 of integer random numbers between 1 and 50, and perform the following operations: a. Generate a (1x3) matrix of the original b. Generate a (4x2) matrix of the original with the row order reversed c. Replace the second column of the matrix with [4; 8 ; 16; -2] ( MATLAB)

Homework Answers

Answer #1

Please find the answer below.
Please do comments in case of any issue. Also, don't forget to rate the question. Thank You So Much.

clc
clear
%generate random matrix
randMatrix = randi(50,4)

%generate one*three
oneCrossThree = randMatrix(1,1:3)

%generate one*three
fourCrossTwo=randMatrix(4:-1:1,1:2)
randMatrix(1:4,2) = [4; 8 ; 16; -2];
randMatrix

Know the answer?
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
Similar Questions
Generate a 4 x 4 random integer matrix, save it in the variable mat and perform...
Generate a 4 x 4 random integer matrix, save it in the variable mat and perform the following: ( MATLAB) Generate a matrix from the matrix mat that is composed of row 2, row 1 and row 3 of mat Generate a matrix from the matrix mat that is composed on column 2 and 3 of mat Generate a matrix from the matrix mat that starts with column 2 and row 3 and contains all the elements till the end.
Matlab Queatoin: The test suite generates a random M x N matrix with a random number...
Matlab Queatoin: The test suite generates a random M x N matrix with a random number of rows and columns that is assigned to the variable A . The element values of the matrix are random double precision numbers that fall in the range from -10 to 10. The matrix has between 5 and 10 rows and between 5 and 10 columns. Assuming A is defined in the workspace, write a script with commands to perform the operations described below...
Generate 1000 random numbers between 0 and 1*Create a frequency table with the following Generate 1000...
Generate 1000 random numbers between 0 and 1*Create a frequency table with the following Generate 1000 random numbers between 0 and 1*Create a frequency table with the following bins 0, 0,1, 0.2, ..., 0.8, 0.9 , 1Find the expected value bins 0, 0,1, 0.2, ..., 0.8, 0.9 , 1Find the expected value
In the code space provided in Matlab Grader, create a function that: 1. Accepts an input...
In the code space provided in Matlab Grader, create a function that: 1. Accepts an input matrix A as its only input argument. Matrix A is a 3x3 matrix of random integers between 1 and 4 2. Produces and output matrix B as its only output argument. Matrix B will also be a 3x3 matrix. 3. Calculates the elements of matrix B such that: a. the values of B along the diagonal are equal to the respective elements in A...
Lottery The lottery game matches three different integer numbers between 1 and 10. Winning depends on...
Lottery The lottery game matches three different integer numbers between 1 and 10. Winning depends on how many matching numbers are provided by a player. The player provides three different integers between 1 and 10. If there is a match of all 3 numbers, the winning $ 1000. If there is a match with 2 numbers, the winning $ 10. If there is a match with 1 number, the winning $ 1. With no match, the winning is $0. Write...
Write a PHP code that: 1- Creates an array that holds 10 random integer numbers between...
Write a PHP code that: 1- Creates an array that holds 10 random integer numbers between 1 and 100. 2- Moves all multiple of 3-numbers in the array that created in part-a into a new array. 3- Moves all multiple of 5-numbers in the array that created in part-a into a new array. 4- Find the maximum and the minimum multiple of 3-numbers, if exist. 5- Find the maximum and the minimum multiple of 5-numbers, if exist. 6- Prints the...
1.) Generate an array of 10 random numbers between 1 - 100 2.) Copy the array...
1.) Generate an array of 10 random numbers between 1 - 100 2.) Copy the array to a temp array 3.) Call each of the methods to sort (bubble, selection, insertion, quick, merge), passing it the array 4.) In-between the calls, you are going to refresh the array to the original numbers. 5.) Inside of each sorting method, you are going to obtain the nanoseconds time, before and after the method Subtract the before time from the after time to...
1. (2 pts) Create the probability distribution for the following random variable. The total difference between...
1. (2 pts) Create the probability distribution for the following random variable. The total difference between two numbers showing when a pair of standard six-sided dice are rolled (largest value - smallest value).
Create a program that generates a file of random numbers, and then prints them in neat...
Create a program that generates a file of random numbers, and then prints them in neat fashion to another file, and also saves to that file the average and standard deviation of those numbers. I) First, you would need to generate a file of random numbers that consists of N random numbers (100 < N < 1000). Each random digit should be a real number (type double) between 0 and 50. This file and its digits would now serve as...
A large collection of​ one-digit random numbers should have about​ 50% odd and​ 50% even digits\...
A large collection of​ one-digit random numbers should have about​ 50% odd and​ 50% even digits\ because five of the ten digits are odd​ (1, 3,​ 5, 7, and​ 9) and five are even​ (0, 2,​ 4, 6, and​ 8).A. .Find the proportion of​ odd-numbered digits in the following lines from a random number table. Count carefully: 9 9 2 8 9 7 6 5 8 3 0 8 6 0 2 3 7 8 4 9 9 2 8...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT