Skip to content

loadxgendata cannot handle absolute file paths (with or without .m) #282

@yasirroni

Description

@yasirroni

loadxgendata cannot handle absolute file paths (with or without .m). loadxgendata (via loadgenericdata) cannot accept absolute file paths. It only works with function names that are on the MATLAB/Octave path.

Works (filename on path):

xgd = loadxgendata('ex_xgd_uc', mpc);

FAILS (absolute path with .m):

xgd = loadxgendata('/full/path/to/matpower/most/examples/ex_xgd_uc.m', mpc);
% Error: strips .m, then can't find file

FAILS (absolute path without .m):

xgd = loadxgendata('/full/path/to/matpower/most/examples/ex_xgd_uc', mpc);
% Error: not on MATLAB path

Root Cause:

loadgenericdata.m uses feval(rootname) for .m files, which requires the function to be on MATLAB's path. It doesn't support running .m files from arbitrary absolute paths.

Inconsistency:
loadcase() accepts absolute paths with .m extension, but loadxgendata() does not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions