Latex inserts Matlab code, latexmatlab
This article describes how to add Matlab code During Latex formatting.
Functional Effects
Mainly has the following typographical functions:
- Syntax highlighting
- Automatically add borders
- Automatically add row number
First, let's take a look at the effect.
Listings
Package
First, make sure you can useListings
Package
The simple and quick method is as follows:
\ Usepackage {listings} \ lstset {language = Matlab} \ begin {lstlisting} % Plot function f (x) = 2 * x ^ 3-x-2 ezplot ('2 * x ^ 3-x-2 ', [0, 2]) hold onplot ([0, 2], [0, 0], 'R') \ end {lstlisting}
Let's take a look at the effect:
Next, useMcode
Style
Mcode
Package
Mcode
There are three main usage methods
For more information, see the references below.
References
Listings help document
Mcode help document
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.