When transposing vectors/matrices in MATLAB, I\'ve seen and used just the \'
(apostropohe) operator for a long time.
For example:
>&g
This is actually a subject of debate among many MATLAB programmers. Some say that if you know what you're doing, then you can go ahead and use '
if you know that your data is purely real, and to use .'
if your data is complex. However, some people (such as Luis Mendo) advocate the fact that you should definitely use .'
all the time so that you don't get confused.
This allows for the proper handling of input into functions in case the data that are expected for your inputs into these functions do turn out to be complex. There is a time when complex transposition is required, such as compute the magnitude squared of a complex vector. In fact, Loren Shure in one of her MATLAB digests (I can't remember which one...) stated that this is one of the reasons why the complex transpose was introduced.
My suggestion is that you should use .'
always if your goal is to transpose data. If you want to do some complex arithmetic, then use '
and .'
depending on what operation / computation you're doing. Obviously, Luis Mendo's good practices have rubbed off on me.