i2e_field
- i2e_field(mpc, field, ordering, dim)
i2e_field()
- Converts fields ofmpc
from internal to external bus numbering.MPC = I2E_FIELD(MPC, FIELD, ORDERING) MPC = I2E_FIELD(MPC, FIELD, ORDERING, DIM) For a case struct using internal indexing, this function can be used to convert other data structures as well by passing in 2 or 3 extra parameters in addition to the case struct. The 2nd argument is a string or cell array of strings, specifying a field in the case struct whose value should be converted by a corresponding call to I2E_DATA. The field can contain either a numeric or a cell array. The corresponding OLDVAL is taken from where it was stored by EXT2INT in MPC.ORDER.EXT and the updated case struct is returned. If FIELD is a cell array of strings, they specify nested fields. The 3rd and optional 4th arguments are simply passed along to the call to I2E_DATA. Examples: mpc = i2e_field(mpc, {'reserves', 'cost'}, 'gen'); Reorders rows of mpc.reserves.cost to match external generator ordering. mpc = i2e_field(mpc, {'reserves', 'zones'}, 'gen', 2); Reorders columns of mpc.reserves.zones to match external generator ordering.
See also
e2i_field()
,i2e_data()
,int2ext()
.