Answer to Quiz 10 Fri 11 Nov 2005

  1. Consider the linear system
       {  2 x1 + 3 x2 = 1
       { -2 x1 +   x2 = 3.
    
    Give all the MATLAB commands to define this linear system in the format A x = b, with x = [x1 x2]^T, i.e.: what are the commands to define A and b?
    What is the solution of this system? Give all relevant MATLAB commands.

    Answer:

           A = [2  3; -2  1]
           b = [1; 3]
           x = A\b
         
           x =
                -1
                 1
    
    
  2. Consider the curve in polar coordinates defined by r(t) = t sin(t).
    Give all MATLAB commands to make the plot for t in [-1,+1]. Sketch the curve.

    Answer:

           t = -1:0.01:1;
           r = t.*sin(t);
           polar(t,r)