Question: Question 1: 1. Figure out what the following MATLAB code does (Notice that R n = 500 for jay - 1:4 ifjoy > 1;oldtime =

Question 1: 1. Figure out what the following MATLAB code does (Notice that R n = 500 for jay - 1:4 ifjoy > 1;oldtime = time; end M rand(n); t cputime; forrep -1:5 R chol(A): en time = cputime-t; if jay > 1; ratio - time/oldtime, end en If you put these instructions into a file named, say, zap.m, you can run the program by typing zap from the MATLAB command line. The functions randn, cputime, and chol are built-in MATLAB functions, so you can learn about them by typing help randn, etc. You might find it useful to type more on before typing help topic. Alternatively you can read about theme in MATLAB's help browser. 2. Does the code produce reasonable values of ratio when you run it? 3. What value would you expect in theory? Depending on the speed of the machine on which you are running MATLAB, you may want to adjust the initial value of n or the number of times the rep loop is executed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
