copy and paste code with formatting
Mostrar comentarios más antiguos
Is there a way to copy from Matlab editor in a way that preserves formatting, so when I paste into another application it appears just as it did in Matlab? One possibility was if Matlab could receive a Notepad++ plug-in.
I realized that copy and paste works for the Matlab editor, but my actual application was to preserve formatting (font and color) in the Command Window.
3 comentarios
Bob Thompson
el 21 de Feb. de 2019
What formatting are you looking to preserve? Text color?
Larry Brunson
el 21 de Feb. de 2019
Editada: Larry Brunson
el 21 de Feb. de 2019
Rik
el 21 de Feb. de 2019
A Notepad++ plugin is impossible, since there is no way to know if a text should be red, orange or black, even assuming you haven't changed those colors in your preferences.
I had expected that it would already do that (copy with format) to e.g. Word, but apparently that doesn't. I guess there is probably some Java wizardry you could do to do it anyway.
Respuestas (1)
Aniket
el 9 de Jun. de 2025
0 votos
In the MATLAB's new desktop released in R2025a, the text formatting remains preserved when copying from command window.
However, prior to this release, there is no method to preserve formatting. I recommend upgrading to the latest version of MATLAB.
Hope this helps!
Categorías
Más información sobre Desktop en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!