Question: 1 . ( 1 0 pts ) Write a script that reads in the matrices from Homework 1 data.xlsx Here is a good MATLAB command

1.(10 pts) Write a script that reads in the matrices from Homework 1 data.xlsx
Here is a good MATLAB command to use:
A1= readmatrix('Homework 1 data.xlsx','Range','a3:c5')
2.(40 pts) Do the following MATLAB matrix operations using only for loops (meaning - no usage of MATLABs colon : to index through matrices)
a. Multiply: Prob2a = A1*A2
b. Multiply: Prob2b = C1*C2
c. Transpose: Prob2c = C1
d. Element-by-Element Square: Prob2d = B1.^2
e. Matrix Exponential: Prob2e = exp(C1)
3.(20 pts) Subtract your looped solution from MATLABs built-in command solution for each case. Use MATLABs norm command to compute a scalar that is measure of the difference between the looped and MATLAB solutions.
4.(20 pts) Use MATLABs tic and toc commands to measure execution time so you can see how your looped solution time compares with the MATLAB built-in command time. Suggest typing in help tic in the MATLAB command window to see a good example of how to use the command.
5.(10 pts) Use MATLABs disp and sprintf commands to create a formatted table output for the norm and timing calculations. Output should look somewhat like the following:
MATLAB LOOPS Time Ratio
Solution norm time(s) time(s) LOOPS:MATLAB
-----------------------------------------------------------
a |0.0e+000.00007410.00061288.27
b |7.2e-140.00002650.000625023.58
c |0.0e+000.00006750.00033444.95
d |0.0e+000.00008600.004785755.65
e |0.0e+000.00010600.00049884.71

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!