I have this matrix:
mpc.bus = [100 1 170 100 0 0 1 1 0 230 1 1.1 0.9;
110 3 50 30 0 0 1 1 0 230 1 1.1 0.9;
120 2 80 45 0 0 1 1 0 230 1 1.1 0.9;
130 1 200 110 0 0 1 1 0 230 1 1.1 0.9;
140 1 30 8 0 0 1 1 0 230 1 1.1 0.9]
I want to create a sub-matrix that obeys the following rule:
if the value of the second column is equal to 3 or 2, a new matrix (called MatrixPVREF
) will receive the 1st, 2nd, 3rd and 4th column of mpc.bus
.
This is the result I would like to obtain:
MatrixPVREF = [110 3 50 30;
120 2 80 45]