How to generate PDF report using PUBLISH command in MATLAB?

In this video it shows the use of PUBLISH command to generate a PDF report for your MATLAB code.

I hope you like this video. For any questions, suggestions or appreciation please contact us at: or email at:

Complete source code and other details:

Sample MATLAB Script for which report is to be generated:

%% Plot sine and cosine waveform

t = 1:0.1:40;
y = sin(t) + 2*cos(t);

%% Display Text example

disp("Hello Programmer World !!!");

PUBLISH command:

publish('ReportGenerationExample.m', 'pdf')

Screenshots of the output:

Attaching the sample PDF report file generated in this demo:

Leave a Reply