/ concept-collection / windowedFourierProjection
Sign in
concept-collection / windowedFourierProjection
windowedFourierProjection / wfp_1Dspringscattering / saveWorkspace.m
36 lines · 1.2 KBBlameHistoryRaw
1%% determine the file name
2if (uniform_sgrid == 1)
3 str = 'uni'; else; str = 'rand'; end
5% Save only the selected variables
6fileName = sprintf('%s/WFPworkspaceO%d_T%d_%sM%d_b%d',dataFile,order,round(tFinal),str,M,betaMax);
8if (saveWorkspaceOpt == 1)
9 % all variables in the workspace
10 vars = who;
12 % variables to exclude
13 exclude = {'A_sp','It','RHS','deltaInteractions',...
14 'dtInteractions','evalSol','gl','gn','historySum',...
15 'implicitMat','interpAndGLWeights_sol','interpNodesIdx_sol',...
16 'interpShift_sol','it1','it2','p','p0','phi_tn','phit_tn',...
17 'printTimeStep','q','q0','saveWorkspaceOpt',...
18 'sn_v','timeSteppingTime','uniform_beta','uniform_sgrid',...
19 'winData'};
21 % Find variables to save
22 vars_to_save = setdiff(vars, exclude);
23 save(fileName, vars_to_save{:});
24 fprintf('saved workspace to %s\n',matlabDataFile);
26elseif(addErrResults == 1)
27 matlabDataFile =strcat(fileName,'.mat');
28 if(isfile(matlabDataFile))
29 save(fileName, 'sc_err', '-append');
30 fprintf('added error to the data file in %s\n',matlabDataFile);
31 else
32 fprintf('Did not add the error to the data file %s\n',matlabDataFile);
33 end
34end
moveopenescclose