Rowscount if nrows ncols then msgbox matrix not

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
nrows = rng1.Rows.Count If (nrows <> ncols) Then MsgBox "Matrix not square" Exit Sub End If n = nrows If ((rng2.Rows.Count <> n) Or (rng3.Rows.Count <> n) Or _ (rng2.Columns.Count <> 1) Or (rng3.Columns.Count <> 1)) Then
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
MsgBox "RHS or output range not n by 1" Exit Sub End If A = rng1.Value b = rng2.Value x = b ’ Elimination ’ Back substitution rng3.Value = x End Sub Sub GetRange(rng As Range, msg As String) Dim srng As String srng = InputBox(msg) Set rng = Range(srng) End Sub 3. Use your program to solve the linear system Ax = b , where A = 1 1 / 2 1 / 3 1 / 4 1 / 5 1 / 2 1 / 3 1 / 4 1 / 5 1 / 6 1 / 3 1 / 4 1 / 5 1 / 6 1 / 7 1 / 4 1 / 5 1 / 6 1 / 7 1 / 8 1 / 5 1 / 6 1 / 7 1 / 8 1 / 9 and b = 2 - 4 3 7 - 1 4. Do the following problems from the text: 10.2–10.4, 10.20 on pages 293–294.
Image of page 2
5. Use Matlab to solve the linear system Ax = b , where A = 1 1 / 2 1 / 3 1 / 4 1 / 5 1 / 2 1 / 3 1 / 4 1 / 5 1 / 6 1 / 3 1 / 4 1 / 5 1 / 6 1 / 7 1 / 4 1 / 5 1 / 6 1 / 7 1 / 8 1 / 5 1 / 6 1 / 7 1 / 8 1 / 9 and b = 2 - 4 3 7 - 1 You can use the backslash operator. 6. Do problem 11.9 on page 313 of the text. Also show that the criterion for Gauss-Seidel to work is satisfied.
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern