Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started