Exporting MATLAB code to word file

642 views (last 30 days)
Sakshi on 11 Aug 2011
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
The vertical line connecting the For loop with its corresponding end is not appearing. Any suggestions how I can do that ?
  1 Comment
Pedro Rodenas
Pedro Rodenas on 17 Oct 2016
You can export your code to HTML using the function publish(file), and later copy the text in HTML file

Sign in to comment.

Answers (2)

Chirag Gupta
Chirag Gupta on 11 Aug 2011
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 Comment
Sakshi on 11 Aug 2011
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 !

Sign in to comment.

Lenny Jesús Fernández Rojas
%Eliminar el ruido residual.
I = bwareaopen(I,130);


Community Treasure Hunt

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

Start Hunting!