Question

< 3:29 In Class Gauss Elimination and For loops CEE 384: Numerical Methods for Engrs (2024 Spring) 1. Implement a simple "for" loop in MATLAB to compute the sum of the

series 1+2+3+....n. Try your code with n = 100 and 1000. Hint: answer should be n(n+1)/2 -hlome Inland ancuare tr 2. Develop a nested loop for printing prime numbers from 1 to 100. Explain the code in your writeup. 1. For problems 1 and 2, see sum_prime.m 3. Try to develop the code Naive Gauss Elimination yourself. If you need, you can peek at the example given to you. Explore the code. Does it make sense that as n increases, the number of steps in back substitution becomes less significant? Explain your answer with examples. flops_in_gauss_elimination_sol_1.m 4. Explore the code on tic toc. What do you see? Explain the code in your writeup. tic_toc_problem.m Pseudocode for Naïve Gauss Elimination (a) DOFOR k = 1, n-1 DOFOR 1=k+1, n Pseudocode to perform (a) for- ward elimination and (b) back substitution. ◄ Previous Dashboard :!! 5G 50 Calendar (b) 0= 6 To Do factor= ai,kak.k DOFOR j k + 1 to n aj aj factor ak END DO b₁ = b factor bk END DO END DO Xn= bn an.n DOFOR in 1, 1, -1 sum= bi DOFOR j = 1 + 1, n sum sumaijXj END DO X₁ = sum / af, END DO Notifications Inbox

Question image 1