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

Other questions on the subject: Engineering

image
Engineering, 03.07.2019 14:10, cowgyrlup124
Explain the difference laminar and turbulent flow. explain it with the shear stress and the velocity profiles.
Answers: 1
image
Engineering, 03.07.2019 14:10, kayabwaller4589
When at a point two solid phase changes to one solid phase on cooling then it is known as a) eutectoid point b) eutectic point c) peritectic point d) peritectoid point
Answers: 3
image
Engineering, 04.07.2019 18:10, bunnles
During a steady flow process, the change of energy with respect to time is zero. a)- true b)- false
Answers: 2
image
Engineering, 04.07.2019 18:10, DestyHilBan1183
Adouble-strand no. 60 roller chain is used to transmit power between a 13-tooth driving sprocket rotating at 300 rev/min and a 52-tooth driven sprocket. a) what is the allowable horsepower of this drive? b) estimate the center-to-center distance if the chain length is 82 pitches. c) estimate the torque and bending force on the driving shaft by the chain if the actual horsepower transmitted is 30 percent less than the corrected (allowable) power.
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 in other subjects:

Konu
Mathematics, 21.12.2019 19:31