loadcase

loadcase(casefile)

loadcase() - Load .m or .mat case files or data struct in MATPOWER format.

[BASEMVA, BUS, GEN, BRANCH, AREAS, GENCOST] = LOADCASE(CASEFILE)
[BASEMVA, BUS, GEN, BRANCH, GENCOST] = LOADCASE(CASEFILE)
[BASEMVA, BUS, GEN, BRANCH] = LOADCASE(CASEFILE)
MPC = LOADCASE(CASEFILE)

Returns the individual data matrices or a struct containing them as fields.

Here CASEFILE is either (1) a struct containing the fields baseMVA,
bus, gen, branch and, optionally, areas and/or gencost, or (2) a string
containing the name of the file. If CASEFILE contains the extension
'.mat' or '.m', then the explicit file is searched. If CASEFILE contains
no extension, then LOADCASE looks for a MAT-file first, then for an
M-file.  If the file does not exist or doesn't define all required
matrices, the routine aborts with an appropriate error message.

If the input data is from an M-file or MAT-file defining individual
data matrices, or from a struct with out a 'version' field whose
GEN matrix has fewer than 21 columns, then it is assumed to be a
MATPOWER case file in version 1 format, and will be converted to
version 2 format.