Unless your real problem uses $a'$ more than once (especially if it is expensive to calculate), you can just as easily that I have mixed using of and style notation for pedagogical reasons. FullForm]Īs an aside, I don't see any point assigning the variable inv to represent the Inverse of a. If you discover you have erroneously created a matrix wrapped in MatrixForm, you can change it back to a list using First. As you can see, in your version of the code, a has head List while b has head MatrixForm. It is common for people to use postfix ( //) notation to check this. You can check whether your expressions have compatible Heads using FullForm. When its arguments are not lists or sparse arrays, Dot remains unevaluated. Matrix/tensor operations like Dot and Inverse are designed to work with lists, that is, expressions with a Head of List. I thought nonetheless that it is worth providing some additional information that might help explain how to diagnose similar issues. But other than that I can't think of any use for MatrixForm.ĭavid's answer is correct and the one you need to solve your specific problem. (Of course you can use TraditionalForm in place of MatrixForm).Ĭoming back to the issue of TraditionalForm vs MatrixForm for matrices: the only problem I can see with using the former is that it looks "too nice" so that if the rest of your output is in StandardForm the style of your matrices will not match the rest of your output. Or you can put it into an init file and have it evaluate automatically. Finally, if you would like all your matrices always to appear in MatrixForm and avoid these evaluation problems, you can evaluate at the beginning of your Mathematica session $Post = If, MatrixForm, #] & The keyboard shortcut for this is Ctrl- Shift- T. In fact, you can also set the format type of your input cells to TraditionalForm, although you have to be a little careful if you do that (doing that is not recommended by WRI but it has some well known supporters.).Īlternatively you can use the ConvertTo menu to convert any matrices to TraditionalForm while keeping other cells or expressions in StandardForm (if you prefer that). If you wish your matrices always look like matrices (in the output) you can set the format type of output cells to TraditionalForm (use the Appearance tab in the Preferences menu). Cross products with respect to fixed three-dimensional vectors can be represented by matrix multiplication, which is useful in studying rotational motion. The first is that, in my opinion, MatrixForm is "essentially" obsolete. While the question has been more than answered there are still some things that seem to me worth adding.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |