Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions

Question

=+ (d) Show that a cyclic permutation is ergodic but not mixing.

Answered: 1 week ago

Question

Discuss various types of training methods.

Answered: 1 week ago

Question

Illustrate the value of different types of employment tests.

Answered: 1 week ago

Question

Outline key considerations when making a hiring decision.

Answered: 1 week ago