This code has the major advantage of being strongly typed and giving a sparse matrix. It's arguably much more readable than the Matlab equivalent, but some people prefer fewer keystrokes, so which is better is more a matter of taste. If you'd rather just print it to the screen, do this:
"In short: do not use the auto keywords with Eigen's expressions, unless you are 100% sure about what you are doing. In particular, do not use the auto keyword as a replacement for a Matrix<> type."
(not that either of those expressions would be equivalent to the MATLAB one anyways)
0
u/I_Feel_It_Too Aug 08 '19
Actually, the equivalent is
This code has the major advantage of being strongly typed and giving a sparse matrix. It's arguably much more readable than the Matlab equivalent, but some people prefer fewer keystrokes, so which is better is more a matter of taste. If you'd rather just print it to the screen, do this:
Now, how to you make a list in Matlab? You literally can't.