Problem-7: Equations Solving and Performance The mldivide () method of solving e
ID: 2268283 • Letter: P
Question
Problem-7: Equations Solving and Performance The mldivide () method of solving equations is in general faster and more accurate than the matrix inverse (inv) Using both techniques, solve the system of equations below and time the executin with the tic and toc functions. The tic keyword should be placed before your code and the toc keyword after your code. Using disp or fprintf, display the time taken by each method in a sentence. In some cases, you may not be able to tell the difference between the two methods. 3x1 4x2 + 2x3 -x4 +x5 7x6 x7 42 2x1-2x2 + 3x3-4x4 + 5x5 + 2x6 + 8x7 = 32 x1 2x2 + 3x3 + x4 + 2x5 4x6 6x7-12 5x1 + 10x2 + 4x3 + 3x4 + 9x5-2x6 + x7 -5 3x1 + 2x2-2x3-4x4-5x5-6x6 + 7x7 = 10 -2X1 + 9x2 + X3 + 3x4-3x5 + 5x6 + X7=18 xi-2x2-8x3 + 4x4 + 2x5 + 4x6 + 5x7 = 17 Problem-8: Engineering Design 1. What is the importance of creativity in engineering? 2. What are the barriers of creativity 3. What is concept evaluation and what is its purpose?Explanation / Answer
Solution of problem 7:
A = [3 4 2 -1 5 7 1;2 -2 3 -4 5 2 8;1 2 3 1 2 4 6;
5 10 4 3 9 -2 1;3 2 -2 -4 -5 -6 7;-2 9 1 3 -3 5 1;1 -2 -8 4 2 4 5];
b = [42;32;12;-5;10;18;17];
tic
sol1 = inv(A)*b;
t1=toc;
fprintf('Time taken for solving using mldivide method%f ',t1);
tic
sol1 = A;
t2 =toc;
fprintf('Time taken for solving using mldivide method%f ',t2);
command window log:
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.