Matlab How to Print

Hey there, fellow Matlab enthusiasts! Are you struggling to print your Matlab code or results? Well, worry no more because we have got you covered. In this article, we will guide you on how to print your Matlab code and results with ease.

Printing in Matlab

Printing in Matlab is an essential aspect, especially when you want to present your results to your supervisor or a team member. As such, it’s essential to know how to print your code and results in the most effective manner, whether in color or black and white.

Printing Code in Matlab

Printing Matlab code involves copying the code and pasting it into a word processor. However, the process might be tedious, especially when you have long lines of codes.To make the process easy, you can use the ‘publish’ function, which generates an HTML file that you can easily print. The function is simple to use, and it’s ideal when you want to print your code and results together.To use the function, follow the steps below:1. Open the script or function you want to print2. Type ‘publish’ followed by the name of the file.3. Add the output format you want, for instance, ‘html,’ ‘pdf,’ or ‘docx’4. Press enter, and the file will generate.You can then open the generated file and print it using your preferred method.

Printing Results in Matlab

Printing results in Matlab is as simple as running the code and pressing ‘ctrl+p.’ However, to print the results in color, you need to configure your printer’s settings. You should select the ‘color’ option and check the ‘print background colors’ box.If you’re printing your results in black and white, you should deselect the ‘print background colors’ box. This will ensure that your results are legible and easy to read.

Tips on Printing in Matlab

To get the best results when printing in Matlab, you should consider the following tips:1. Use the ‘publish’ function to generate an HTML file when printing code and results together.2. Configure your printer’s settings to ensure that you print your results in the desired format and color.3. Add comments and annotations to your code before printing to make it easier to read.4. Use the ‘print preview’ option to ensure that your document is formatted correctly before printing.


Printing in Matlab is an essential aspect, particularly when you want to present your results to a team member or supervisor. With the above tips and techniques, you can easily print your code and results in color or black and white. We hope this guide has been helpful to you, and we look forward to sharing more insightful articles with you in the future. Until then, happy printing!