matlab - add a fixed number as a column to a matrix? -
If
A = [1 2 3; 2 3 4; 5 6 7; 3 4 5]
How can I use Matlab as a column by adding a certain number of 10 to A:
A = [1 2 3 10; 2 3 4 10; 5 6 7 10; 3 4 5 10]
As already mentioned in the comment, an easy And the best way to do this:
A (:, end + 1) = 10
Comments
Post a Comment