parsave

This function allows you to save variables inside a parfor loop.

You are now following this Submission

Unlike MATLAB's solution, the variables are saved with their variable names'. You must call this function for each variable you want to save, but the function will not overwrite previous mat files.

function parsave(fname,data)

var_name=genvarname(inputname(2));
eval([var_name '=data'])

try
save(fname,var_name,'-append')
catch
save(fname,var_name)
end

Cite As

Philip (2026). parsave (https://au.mathworks.com/matlabcentral/fileexchange/30778-parsave), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.2.0.0

Edited description.

1.0.0.0