subject
Engineering, 17.03.2020 23:20 saabrrinnaaa

In this this problem you will be using for loops to take a matrix of random number and create a new matrix that is the same as the random matrix, but with zeros on the diagonal. a) Create matrix m that is a 10x10 matrix of random whole numbers from 1 to 20. You will have to manipulate the random number generator function to modify the interval and get only whole numbers. b) Create a for loop that runs for index i equal to the index for every row in the matrix. Next, create a nested for loop that runs for index j equal to the index for every column in the matrix. This is very similar to the Your Turn - Extra slide of Lecture 13. c) Now, we want to use our for loops to create a new niatrix, n, that is equal to matrix m, but with zeros on the diagonal. You should use an if/else statement to create this new matrix. If the location is on the diagonal (i=j), then the value of matrix n at the location will be zero. Otherwise, the value of matrix n equals the value of matrix m at each location

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 19:10
The short distance from the objective lens to the object causes problems at high magnification. which of the following is the most serious? a. cleaning the object surface b. positioning the object c. reflection from the object surface. d. illumination of the object
Answers: 1
question
Engineering, 06.07.2019 03:20
Aparticle moves along a straight line such that its acceleration is a=(4t^2-2) m/s, where t is in seconds. when t = 0, the particle is located 2 m to the left of the origin, and when t = 2, it is 20 m to the left of the origin. determine the position of the particle when t=4s.
Answers: 1
question
Engineering, 06.07.2019 04:10
Aspherical thermocouple measurement errors a spherical thermocouple made of constantin transfer coefficient between the gas and the thermocouple is h used to measure the temperature of a gas. the heat 400 w/m2 k. calculate the maximum diameter d of the thermocouple if the thermocouple's measurement error should be w 23 within 5% of the initial temperature difference in 5 seconds. for constantin, k 8920 kg/m3, and c 410 j/kg. k.
Answers: 3
question
Engineering, 06.07.2019 04:30
What does stp and ntp stands for in temperature measurement?
Answers: 3
You know the right answer?
In this this problem you will be using for loops to take a matrix of random number and create a new...
Questions
question
English, 05.09.2020 19:01
question
Mathematics, 05.09.2020 19:01
Questions on the website: 13722361