This approach buries the filename within S, the runPfx handle isn't very intuitive if you're looking for something like S.outputFilename, and it's hard to find or know how to change the filename (it's currently placed 150 lines away from the GEMB call in MASTER_RUN.m).
There's an additional layer of confusion because in the example above, S2A1D2 is not the complete name of the output file, because S2A1D2 is later automagically converted to S2A1D2_000001 inside a function called combineStrucData_GEMB.m, and then that's used by the GEMB function to create S2A1D2_000001.mat.
The GEMB function also overwrites any files that might have the same automagically created name, without warning.
Because GEMB doesn't output anything to the workspace, as a user I get this feeling that I'm giving GEMB a strangely cobbled together collection of inputs, the function does something for five or ten minutes, and then if all goes well, I might end up with a .mat file somewhere on my computer, by a name I didn't explicitly ask for, and no actual data in the workspace.
I propose changing the GEMB call to look something like this:
GEMB should directly provide the outputs to the workspace if the user wants them, which would provide a more direct conceptual link from function input to output, and
only save the data to a file if the user explicitly asks for it (and include a guardrail to protect against overwriting).
Currently, the only way to define the
GEMB
output data filename is by specifying something like:before calling
This approach buries the filename within
S
, therunPfx
handle isn't very intuitive if you're looking for something likeS.outputFilename
, and it's hard to find or know how to change the filename (it's currently placed 150 lines away from theGEMB
call inMASTER_RUN.m
).There's an additional layer of confusion because in the example above,
S2A1D2
is not the complete name of the output file, becauseS2A1D2
is later automagically converted toS2A1D2_000001
inside a function calledcombineStrucData_GEMB.m
, and then that's used by theGEMB
function to createS2A1D2_000001.mat
.The
GEMB
function also overwrites any files that might have the same automagically created name, without warning.Because
GEMB
doesn't output anything to the workspace, as a user I get this feeling that I'm givingGEMB
a strangely cobbled together collection of inputs, the function does something for five or ten minutes, and then if all goes well, I might end up with a .mat file somewhere on my computer, by a name I didn't explicitly ask for, and no actual data in the workspace.I propose changing the
GEMB
call to look something like this:The idea is that
GEMB
should directly provide the outputs to the workspace if the user wants them, which would provide a more direct conceptual link from function input to output, and