user2895168
user2895168

Reputation: 31

Translating matlab to c++

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

Answers (1)

Mailerdaimon
Mailerdaimon

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

Related Questions