How can I assign values to a column of an armadillo matrix?
Let's say I have a 2x2 matrix (initialized to zeros) and I want to fill the second column with arbitrary values e.g [1; 3]
In MATLAB I would do something like:
A(:,2)=[1; 3]
However when I try:
A.col(1) << 1 << endr << 3 << endr;
I get en error as operator <<
is not supported by subviews.
Thanks a lot for your help!
How about
A.col(1) = vec({1,2});
If you're working with C++11 ?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With