How to save results to /results *only if* code is being executed on Code Ocean
Using either Linux shell scripting or built-in MATLAB syntax.
On Code Ocean, files need to be saved to /results
to be visible as results.
When you export a capsule, it will come with a /results
folder inside the exported folder. Some users may not want a new folder created for them, for example, they are downloading the code and data separately rather than exporting the capsule as a whole -- and their local workflow may be to just wait for figures to pop up in their IDE or terminal.
For these use cases, you can use either shell scripting or MATLAB syntax.
Shell:
MATLAB:
After generating your figure, you'd run something like:
PreviousWhy code files modification times are not being preserved after re-launching a cloud workstation?NextCan I upload folders to Code Ocean?
Last updated