Hi all,
I am working on a program that bootstrapping some estimations for 100 times. This program generates a matrix with 100 rows and 2 columns.
pc_w_total =
1 2
4 5
7 8
10 11
13 14
16 17
...
...
I want to extract 3 rows and 1 column at a time to form a new matrix – each with a different name. The expected result would be the following matrices:
pc_w_total_1 =
1
4
7
pc_w_total_2 =
10
13
16
and so on.
Instead of writing 33 matselrc commands, such as:
matselrc pc_w_total pc_w_total_1, r(1/3) c(1)
matselrc pc_w_total pc_w_total_2, r(4/6) c(1)
matselrc pc_w_total pc_w_total_3, r(7/9) c(1)
matselrc pc_w_total pc_w_total_4, r(10/12) c(1)
….
matselrc pc_w_total pc_w_total_32, r(94/96) c(1)
matselrc pc_w_total pc_w_total_33, r(97/100) c(1)
I need to create a loop that will do the task.
Anyway I can do this? Thanks.
Amy Liu
Australian National University
[email protected]
I am working on a program that bootstrapping some estimations for 100 times. This program generates a matrix with 100 rows and 2 columns.
pc_w_total =
1 2
4 5
7 8
10 11
13 14
16 17
...
...
I want to extract 3 rows and 1 column at a time to form a new matrix – each with a different name. The expected result would be the following matrices:
pc_w_total_1 =
1
4
7
pc_w_total_2 =
10
13
16
and so on.
Instead of writing 33 matselrc commands, such as:
matselrc pc_w_total pc_w_total_1, r(1/3) c(1)
matselrc pc_w_total pc_w_total_2, r(4/6) c(1)
matselrc pc_w_total pc_w_total_3, r(7/9) c(1)
matselrc pc_w_total pc_w_total_4, r(10/12) c(1)
….
matselrc pc_w_total pc_w_total_32, r(94/96) c(1)
matselrc pc_w_total pc_w_total_33, r(97/100) c(1)
I need to create a loop that will do the task.
Anyway I can do this? Thanks.
Amy Liu
Australian National University
[email protected]
Comment