e2i_field

e2i_field(mpc, field, ordering, dim)

e2i_field() - Converts fields of mpc from external to internal indexing.

This function performs several different tasks, depending on the
arguments passed.

MPC = E2I_FIELD(MPC, FIELD, ORDERING)
MPC = E2I_FIELD(MPC, FIELD, ORDERING, DIM)

When given a case struct that has already been converted to
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 E2I_DATA. The field can contain either a
numeric or a cell array. The converted value is stored back in the
specified field, the original value is saved for later use 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 E2I_DATA.

Examples:
    mpc = e2i_field(mpc, {'reserves', 'cost'}, 'gen');

    Reorders rows of mpc.reserves.cost to match internal generator
    ordering.

    mpc = e2i_field(mpc, {'reserves', 'zones'}, 'gen', 2);

    Reorders columns of mpc.reserves.zones to match internal
    generator ordering.

See also i2e_field(), e2i_data(), ext2int().