フィルターのクリア

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 Center および File ExchangeFile Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by