title: Ambiguity in DCM to Quaternion conversion using the default Simulink library block
body: <p>I am simulating a system where I need Direction Cosine Matrix to quaternion conversion. I use the default DCM to Quaternion conversion block available in simulink. However at some points of the simulation, the output quaternion components reverse sign. </p>
  
  <p>Unfortunately I cannot attach the plot image. </p>
  
  <p>Though this is mathematically correct I desire a smooth change. Any idea on how to avoid this and have a smooth curve for the quaternion? </p>
  
  <p>Update 1:
  <a href="http://tinypic.com/view.php?pic=33dayap&amp;s=6" rel="nofollow">http://tinypic.com/view.php?pic=33dayap&amp;s=6</a></p>
  
  <p>Above is the simulated plot. The first plot is of the output quaternion. Second plot is of the Direction Cosine Matrix. As you see that even though the dcm components change smoothly, the quaternion changes sign abruptly. </p>