필터 지우기
필터 지우기

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

조회 수: 5 (최근 30일)
Mujhaid
Mujhaid 2014년 6월 15일
편집: Marvin Clifford Feike 2023년 11월 7일
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
Mujhaid
Mujhaid 2014년 6월 15일
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 2014년 6월 16일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Marvin Clifford Feike
Marvin Clifford Feike 2023년 11월 7일
편집: Marvin Clifford Feike 2023년 11월 7일
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

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by