dplanet
dplanet

Reputation: 5413

Matrix operation in SAS/IML

In SAS/IML, I'm doing the following:

    matrix = {1 2 3 4 5, 2 3 1 2 3, 8 4 8 1 1};
    empty = j(5,5);
do i=1 to 5;
    empty[i,] = matrix[1,];
end;

So I want to replace the ith row of "empty" with the first row of matrix, but this code doesn't work. How can I replace entire rows of a matrix like this?

Upvotes: 1

Views: 300

Answers (1)

Feng Mai
Feng Mai

Reputation: 3109

If you are trying to replace every row of 'empty' with matrix[1,], I don't see any thing wrong with the code.

Upvotes: 1

Related Questions