Reputation: 31
i`m trying to translate some matlab code to c++ row by row without any bigger matlab knowledge. Everything went well till this one:
a = [1; A(:,n)];
I understand this is some matrix generation with its first row/first column element being 1, but Im not quite sure what the next part should do. Could you please give me a hint? "A" is a twodimensional double matrix, "n" is a for loop counter as I understand.
Regards
midin
Upvotes: 1
Views: 102
Reputation: 6080
A(:,n)
means: all Elements (:
) from column n
So a
= [1; all Elements for column n
in A
]
a = [1; A_n1; A_n2; A_n3 ...]
Upvotes: 1