MATLAB profiler: Difference between revisions

From Fluids Wiki
Jump to navigation Jump to search
No edit summary
 
(One intermediate revision by the same user not shown)
Line 7: Line 7:
== How to include MATLAB profiler output in LaTeX ==
== How to include MATLAB profiler output in LaTeX ==


First run the profiler, and print the result to a .ps (postscript) file
First run the profiler, and print the result to a postscript file called out.ps


Second, run these linux commands:
Second, run these linux commands:
Line 18: Line 18:
pdftk A=out.pdf cat 1 output page.pdf
pdftk A=out.pdf cat 1 output page.pdf


# crop the borders
# crop the whitespace around the edges
pdfcrop page.pdf final.pdf
pdfcrop page.pdf final.pdf
</syntaxhighlight>
</syntaxhighlight>


Now you can include final.pdf in your LaTeX document.
Now you can include final.pdf in your LaTeX document.

Latest revision as of 10:48, 8 July 2011

How to use MATLAB profiler

Run the following command, replace "mfilenamehere" with the mfile you wish to profile.

profile clear on; mfilenamehere; profile off viewer

How to include MATLAB profiler output in LaTeX

First run the profiler, and print the result to a postscript file called out.ps

Second, run these linux commands:

# convert out.ps to out.pdf
ps2pdf out.ps

# extract page 1
pdftk A=out.pdf cat 1 output page.pdf

# crop the whitespace around the edges
pdfcrop page.pdf final.pdf

Now you can include final.pdf in your LaTeX document.