After reading this lesson, you should be able to:
know why MATLAB is useful for engineers and scientists,
know how to get MATLAB on your computer,
comprehend the free alternatives to MATLAB.
Publishing does several helpful things for you if you make good use of sections. Each of the following reflects the use of sections to split up different portions of the m-file (e.g., different exercises).
Figure 1: Example of published format.
A published file:
Automatically links the sections contained in the m-file at the top of the published file. Click the link, and it takes you to that section.
Can be saved in multiple file formats including .html and .pdf.
Highlights each section and displays outputs directly below it.
Shows comments as a description for each section (see below).
In the toolbar, select the “PUBLISH” tab. Then click the “Publish” button on the far right of this figure.
Figure 2: Publish tab in MATLAB toolbar.
You have two options to get a pdf. You can either change the publish settings to publish natively in pdf, or you can convert the html file into pdf using your internet browser.
Publish as HTML (default) Then Convert to PDF - Here are a couple of tips for converting from html to pdf. Keep in mind you can open the .html file in your web browser. So, you should start by doing that.
For Chrome and Microsoft Edge, go to print, click “Change” to change printer, then click “Save as PDF” (for Chrome) or “Microsoft Print to PDF” (for Edge), and select where to save the .pdf file. Other browsers should have a similar procedure to save a .html file.
Publish Directly as a PDF - Click the arrow under Publish (seen in Figure 2) to open “Edit Configurations” (see Figure 3). Then change “Output file format” from html to pdf. Remember, it will be html by default.
Figure 3: Edit publishing configurations window where you can change the output file format.
|Create a new section
%% section name