Error message

  • Notice: Trying to get property of non-object in filter_default_format() (line 532 of /home/ntroutman/webapps/nt_drupal/modules/filter/filter.module).
  • Notice: Undefined variable: options in filter_process_format() (line 911 of /home/ntroutman/webapps/nt_drupal/modules/filter/filter.module).

MatLab Woes: Contour Plots of Scalar Valued Functions of Vectors

So MatLab can be cool at times, and at others rather annoying. So the big deal with matlab is everything should be matrix or vector operations, yet they don't make this particullarly easy, especially those of us who learned to program in other languages that like for-loops. My big grip at the moment is the contour plotting function. It's just annoying. They assume, wrongly, that the only things people contour are multi-valued functions, such as f(x,y). Now this is great, some people do that. Others of us have functions f:R2->R which is a scalar valued function of a vector, perfect for contour plots, but can we do that? No! Matlab does not take a vector to scalar function and plot its contours. Now, you can get around this by doing the annoying transformation of g(v)=v'*A*v into f(x,y) = [x,y] * A * [x;y]. Okay, thats not to bad, I can handle that on occasion, except matlab gets annoyed at us ands spits out warnings complaining that its having to iterate over the inputs for your function since it doesn't work on arrays. In all fairness there is probably some way to make v'*A*v evalute over w, w'*A*w, where w =[v1 v2 v3 ... vn], but I couldn't figure it out.

</rant>

Add new comment