How do I direct the publish html output to the user given directory in which the resulting workspace is saved at the end of the script?
Mostra commenti meno recenti
I want to write the publish output (html) into the corresponding directory folder of the processed measurement into which the workspace is saved as well. The default folder name "html" should become something like "html data 2017-04-28_1_191221" where '_1_' enumerates the current run of measurement '191221'. This way getting the following structure:
- Specimen 1
- measurement 191221
- Workspace_<date>_1_191221 √ this works already
- Workspace_<date>_2_191221 √ this works already
- html_<date>_1_191221 - to be solved
- html_<date>_2_191221 - to be solved
- measurement yyyyyy...
- Specimen 2...
Risposta accettata
Più risposte (1)
Kristen Amaddio
il 27 Lug 2017
You can specify an output directory for the HTML files using the 'outputDir' property:
You can either specify this in the 'options' for the 'publish' function, or within the call to 'publish' itself.
For example, in order to publish the file in the directory 'html_<date>_1_191221' for run 1 of measurement 191221, you would do the following:
% These can be defined within the loops you are using
run = 1; measurement = 191221;
% Specify the desired output directory, then publish the file
outDir = strcat('html_',datestr(now,'yyyy-mm-dd'),'_',num2str(run),'_',num2str(measurement));
publish('myFile.m','outputDir',outDir)
2 Commenti
Manfred
il 30 Lug 2017
Baptiste Ottino
il 3 Ago 2017
I don't think that is necessary. Is there any particular reason you want to use the publish button and not the function directly? If you used the function, Kristen's solution would probably work.
You can also try the "Edit Publishing Options" button (the down-facing arrow under "Publish"). It allows you to specify the output directory for the html file, but only for the current script if I am not mistaken.
Categorie
Scopri di più su Share and Distribute Software in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!