A brilliant and easy to use programming platform, MATLAB allows scientists, engineers, and other mathematics professionals to effortlessly express computational maths. However, the program naturally exports any written code in the form of its native code file, which might not be the best option when it comes to sharing files with different people, especially if they don’t already use MATLAB. In that case, sending a PDF file might be the smartest choice.
But can you actually save your MATLAB code in the form of a PDF? Here is a quick guide that might help:
Saving MATLAB files as PDFs
While MATLAB doesn’t actually allow you to ‘save’ a file as a PDF, following the same process as you would in some other platforms, you do have the opportunity to export code as a PDF using the ‘Publish’ feature. Here’s how:
- If you haven’t already, open the file you’d like to save as a PDF in MATLAB.
- Press the down arrow that’s located right next to the Publish icon (tilted sheet of paper) in the toolbar at the top. Here, select the ‘Edit Publish Configurations’ option.
- In the new window that pops up, locate the ‘Output File Format’ section. Here, click on the current extension (usually HTML) to open a drop-down menu.
- From the menu, simply select the PDF option.
- Then, click on the Publish button to view your code as a PDF file.
- Finally, go to Save or Print as you normally would.
And that’s it! Although it requires a couple of additional steps, you can effortlessly save your MATLAB codes as PDF files, just by following the handy guide above.