subject
Engineering, 31.10.2019 00:31 cassidy100117

Given the expression, viz (-1/3) (2n + 1) a. write a matlab program in a script file hw6p3a. m that does the following: 1. (4 pts) determines the value of the expression above for a given m, entered by the user. use a for loop to determine the value of the expression by adding terms to the sum. ii. (2 pts you should notice that the value of the expression determined by your program approaches the value of pi in matlab as the number of terms increases. create a variable called prec (refers to precision), which refers to the absolute difference between the value of the expression and the value of pi in matlab. iii. (2 pts) use fprintf before the end of the loop to display the results as: for n = 1, value = x. to a precision of x. for n = 2, value = x. to a precision of x. use format i %.15f, $.10e for n, the value of expression, and the precision respectively. iv. (2 pts) use your program with m = 5 and 15. b. (4 pts) modify your program and save it to a new script file hw6p3b. m to terminate the loop once the precision reached a tolerance of 10–5. this can be done using a break statement. deactivate the printing inside the loop, instead, once the loop is terminated, the program must display the last value of the expression and how many passes the program takes to reach this value as a value of x. in xx passes with a precision of x. use format 8.15, %2i, 4.6e for the value of expression, n, and the precision, respectively. (1 pt) run this case with m = 100.

ansver
Answers: 3

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Determine whether or not it is possible to compress air adiabatically from k to 140 kpa and 400 k. what is the entropy change during this process?
Answers: 3
question
Engineering, 04.07.2019 18:10
Which of the following controllers anticipates the future from the slope of errors over time? a)-proportional b)-on/off c)-integral d)-derivative.
Answers: 2
question
Engineering, 04.07.2019 18:10
Compute the pressure drop of 30Β°c air flowing with a mean velocity of 8 m/s in a circular sheet-metal duct 300 mm in diameter and 15 m long. use a friction factor, f 0.02, and pair = 1.1644 kg/m a. 37.26 pa b. 25.27 pa n c. 29.34 pa d. 30.52 pa
Answers: 1
question
Engineering, 04.07.2019 18:20
Asolid cylinder is concentric with a straight pipe. the cylinder is 0.5 m long and has an outside diameter of 8 cm. the pipe has an inside diameter of 8.5 cm. the annulus between the cylinder ad the pipe contains stationary oil. the oil has a specific gravity of 0.92 and a kinematic viscosity of 5.57 x 10-4 m2/s. most nearly, what is the force needed to move the cylinder along the pipe at a constant velocity of 1 m/s?
Answers: 3
You know the right answer?
Given the expression, viz (-1/3) (2n + 1) a. write a matlab program in a script file hw6p3a. m that...
Questions
question
Mathematics, 11.01.2021 02:20
question
Mathematics, 11.01.2021 02:20
question
Mathematics, 11.01.2021 02:20
question
Mathematics, 11.01.2021 02:20
question
Mathematics, 11.01.2021 02:20