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.
@Chris: Nevermind, I see your error when called inside a parfor loop. I'm not sure how to update the code, it seems Mathworks has closed this loophole.
Whe I use your function in R2016a it results in a "Transparency violation error"; line 3 seems to cause the error. Any known workaround?
sorry, I got it. I was sending the data part for parsave in quotes. Sorry Again
I tried using this function where in I want to save the data in a variable Dataset_info but the variable which gets saved in the matfile is named 'x'.
What I'm trying is, inside the parfor loop I'm using parsave([path,'Dataset_info.mat'],Dataset_info);
Is this correct? I want to save the Matfile as Dataset_info.mat with the data variable stored as Dataset_info as well. It contains cell array data.
What does this have to do with saving variables in a parfor loop?
Please read carefully this: http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F