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, 03.07.2019 14:10
Amass of 1.5 kg of air at 120 kpa and 24°c is contained in a gas-tight, frictionless piston-cylinder device. the air is now compressed to a final pressure of 720 kpa. during the process, heat is transferred from the air such that the temperature inside the cylinder remains constant. calculate the boundary work input during this process.
Answers: 2
question
Engineering, 03.07.2019 14:10
Line joining liquid phase with liquid and solid phase mixture is known as: a) liquidus b) solidus c) tie line d) none of the mentioned
Answers: 2
question
Engineering, 04.07.2019 18:10
For the closed feedwater heater below, feedwater enters state 3 at a pressure of 2000 psia and temperature of 420 °f at a rate of ix10 ibhr. the feedwat extracted steam enters state 1 at a pressure of 1000 psia and enthalpy of 1500 btu/lbm. the extracted er leaves at an enthalpy of 528.7 btu/lbm steam leaves as a saturated liquid. (16) a) determine the mass flow rate of the extraction steam used to heat the feedwater (10) b) determine the terminal temperature difference of the closed feedwater heater
Answers: 3
question
Engineering, 04.07.2019 18:10
Manometers are good examples of measuring instruments, nowadays they are not as common as before. a)-capacitive probe gauges b)-gravitational gauges deformation ) gauges d)-digital gauges
Answers: 1
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
Questions on the website: 13722367