Skip to content

nx_matlab_user_startup

path · scripts/path/nx_matlab_user_startup.m

NX_MATLAB_USER_STARTUP  MATLAB R2026a parity for userpath, pathdef, startup.m

  Called once at the end of user startup-file processing.  Matches MATLAB:
    1. Ensure userpath (<home>/Documents/MATLAB) exists and leads the path
       (after the working-directory entry Nexus keeps for Octave callers)
    2. Honour MATLABPATH / OCTAVEPATH when present (NEXUS_PATH is applied
       earlier in C++; re-apply here so order stays userpath then env dirs)
    3. If a saved pathdef.m is visible under userpath (or Nexus config /
       legacy ~/MATLAB), apply path(pathdef())
    4. Run startup.m when it is on the path (function or script)%
  Safe to call more than once in a session (no-op after the first success).