Exporting MATLAB code to word file

910 ビュー (過去 30 日間)
Sakshi
Sakshi 2011 年 8 月 11 日
コメント済み: Tanveer Hussain 2022 年 11 月 6 日
I want to export my MATLAB code in word file. If I opt for print command directly, the code is getting printed, but the vertical lines that connect the start and end of a loop are not getting shown. For example,
for d=1:s
fraction(d)=vert(d)/add;
if(d==1)
cumulative(d)=fraction(d);
continue
end
cumulative(d)=cumulative(d-1)+fraction(d)
end
The vertical line connecting the For loop with its corresponding end is not appearing. Any suggestions how I can do that ?
  1 件のコメント
Pedro Rodenas
Pedro Rodenas 2016 年 10 月 17 日
You can export your code to HTML using the function publish(file), and later copy the text in HTML file

サインインしてコメントする。

回答 (2 件)

Chirag Gupta
Chirag Gupta 2011 年 8 月 11 日
You can use the publish command to publish the code and the results in a neat manner directly to word, however this will also not show the "line".
This "line" is the MATLAB editor's graphical line to ease with writing and navigating code and as such cannot be navigated to word. The easiest way to to do so is to do Print Screen and cut the relevant image (in Win 7, you can directly use the Windows snipping tool).
  1 件のコメント
Sakshi
Sakshi 2011 年 8 月 11 日
Thanks Chirag. Yeah I had published it earlier but I wanted the lines. I have actually seen some reports with the lines and I doubt if they used printscreen for the same. But anyway, thank you for answering !

サインインしてコメントする。


Tanveer Hussain
Tanveer Hussain 2022 年 11 月 6 日
Brother simplest method is that convert directly into pdf by "ctrl+p" then convert pdf into word.
  2 件のコメント
John D'Errico
John D'Errico 2022 年 11 月 6 日
And as others have said, that does not solve the problem.
Tanveer Hussain
Tanveer Hussain 2022 年 11 月 6 日
Thanks for more details
brother go to the print function in the matlab you can see the various options for the text setting
1) you can chnage the font setting
2)change the stlye
3) export to pdf, microsoft and xps etc
After converting into pdf you can directly convert into word format.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeScripts についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by