Question: Can you write comment lines and use matlab function and subfunction? (True relative error =True error/true value x 100% ) Question: Please convert the given
Question: Please convert the given code to a Matlab program. Please read your book for detailed explanation (Page 72) 1. In your program, please also calculate true percent relative error 2. Discuss your results in a comment section of your program 3. For Bonus Points: Please make sure that summation is performed with a matlab function and subfunction. PROGRAM fig0312 MPLICIT none FIGURE 3.12 Fortran 90 program to sum a number 10s times. The case sums the number 1 in single precision and the number 10 in single ansum2-0 double precision REAL::Suml, sum2, x1, x2 DOUBLE PRECISTON::Sum3, x3 x2-1.e-5 x3-1.d-5 DO i-1,100000 uml sum1+x sum2 sum2+x2 sum3-sum3+x3 END DO PRINTm PRINT sum2 PRINT, * sunn3 00000.000000 1.000990 .999999999980838E-001
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
