Using transpose versus ctranspose in MATLAB

前端 未结 4 2045
长发绾君心
长发绾君心 2020-11-22 15:34

When transposing vectors/matrices in MATLAB, I\'ve seen and used just the \' (apostropohe) operator for a long time.

For example:

>&g         


        
4条回答
  •  悲哀的现实
    2020-11-22 16:02

    There are two cases to distinguish here:

    1. Taking transpose for non-mathematical reasons, like you have a function that is treating the data as arrays, rather than mathematical vectors, and you need your error correcting input to get it in the format that you expect.
    2. Taking transpose as a mathematical operation.

    In the latter case, the situation has to dictate which is correct, and probably only one of the two choice is correct in that situation. Most often that will be to take the conjugate transpose, which corresponds to ', but there are cases where you must take the straight transpose and then, of course, you need to use .'.

    In the former case, I suggest not using either transpose operator. Instead you should either use reshape or just insist that the input be make correctly and throw an error if it is not. This clearly distinguishes these "computer science" instance from true mathematical instances.

提交回复
热议问题