Borrar filtros
Borrar filtros

How i can publish help for more then one .m files simultaneously?

5 visualizaciones (últimos 30 días)
Mujhaid
Mujhaid el 15 de Jun. de 2014
Editada: Marvin Clifford Feike el 7 de Nov. de 2023
I have more then 100 m files. Now i want to publish help for them. Publishing help for each individual will take a lot of time. But i want to publish help for all files simultaneously. so it saves my time. is there any way i can do this?
waiting for quick response.
thanks in advance.
  3 comentarios
Mujhaid
Mujhaid el 15 de Jun. de 2014
Yes my code has proper formatting i am just asking by simply clicking on publish button i can publish only help for one m file. But is there any way that i can publish help for more than one files simultaneously as publishing help for each single file will take a lot of time for publishing help for 1000 of m files.
Geoff Hayes
Geoff Hayes el 16 de Jun. de 2014
You could write a script that would get a list of all your m files and then use the publish command on each file in that list. See http://www.mathworks.com/help/matlab/ref/publish.html for details.

Iniciar sesión para comentar.

Respuestas (1)

Marvin Clifford Feike
Marvin Clifford Feike el 7 de Nov. de 2023
Editada: Marvin Clifford Feike el 7 de Nov. de 2023
Just in case, I added a simple script, like it is suggested above.
You have to create a script "scriptPublishing.m", copy the code and execute it in your working directory, where you .m-files are located. It will generate a folder "latex" with the future .tex-files in it. Furhter options can be changed and additional options can turned on. The loop checks the folder for .m-files.
function scriptPublishing
close all; clear; clc;
% Publishing directory
mkdir latex
% Publishing options
options.format = 'latex';
options.outputDir = 'latex\';
options.evalCode = false;
options.catchError = false;
options.codeToEvaluate = false;
options.showCode = true;
% Publishing through folder
listing = dir;
[listingFiles,~] = size(listing);
for i = 1:listingFiles
mFileName = listing(i).name;
if exist(mFileName) == 2 % check if file with extension
[~,~,ext] = fileparts(mFileName);
if isequal(ext,'.m') % check if .m-file
publish(mFileName,options);
end
end
end
end

Categorías

Más información sobre File Operations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by