{matlab} is a high-level scientific programming language with JAVA based interactive environment that enables you to perform computationally intensive tasks as done with traditional programming languages such as C, C++, and Fortran. Its full form is MATrix LABoratory as it uses matrix (linear ...

learn more… | top users | synonyms

32
votes
3answers
22k views

What can I use to typeset MATLAB code in my document?

This question led to a new package: matlab-prettifier Does anybody have a quick and easy way to typeset some relatively long MATLAB code in the appendix? I looked up a few methods, and the ...
37
votes
10answers
23k views

What is the best way to include Matlab graphics?

Which way of exporting Matlab graphics delivers the best result for inclusion in LaTeX? Is it possible to export scalable vector graphics, or even LaTeX graphics?
45
votes
4answers
6k views

3-dimensional histogram in pgfplots

I have a simple 3d histogram which I want to import into pgfplots, e.g. using matlab2tikz or by hand. PGFplots does not offer 3d histograms. Is there an easy way to do this?
33
votes
11answers
24k views

How to avoid large margins around Matlab plot in PDF

I am preparing image files to be included in a latex document. The image file is generated by printing a Matlab plot. If I print the plot in eps format, the content of the eps file is fully occupied ...
14
votes
3answers
10k views

matlab figures with latex fonts

I realize this question might have been asked already, but I'm relatively new to LaTeX and matlab so I need some help. I'm trying to export a figure for inclusion in my tex document (to be compiled ...
14
votes
6answers
9k views

How to export matlab figures to (pdf) LaTeX?

I am writing a student thesis in LaTeX and need to import several figures created in Matlab. I found some programs to do this task: matfig2pgf matlab2tikz fig2texPS The problem is that using one ...
5
votes
1answer
4k views

Inline MATLAB code

I want to write MATLAB code in a sentence. I installed package mcode, no problem if I want to display the code by inserting the code in environment \begin{verbatim} and \end{verbatim}. How could I ...
11
votes
8answers
2k views

What do people use for modifying figures?

I usually create figures for my articles in Matlab: various plots of numerical and analytical solutions. One thing that I don't like about it is that the font is different in the figure and in the ...
7
votes
3answers
2k views

Putting in MATLAB codes in a box as figures? [duplicate]

how do I put MATLAB codes in a box or deal with them as if they are figures? Is there a way to do it within LaTeX itself? I am currently using the verbatim environment to present my codes and to be ...
8
votes
1answer
941 views

pgfplots: color a surf using arbitrary colors

I am trying to figure out if there is an equivalent in pgfplots to what in MATLAB is done through the following command: surf(A,B). This would plot the geometry A, using the colors specified in B. I ...
2
votes
1answer
3k views

How to get Matlab code into a LaTeX document?

I'm trying to put in my thesis matlab code but the results are not very good. I would get something like that but I don't know what packages using and how to create this result:
1
vote
1answer
2k views

Translating Matlab figures into TikZ

When ever I want to write a research paper and print the simulated results (by Matlab) into an .eps file, I think of a direct way of translating Matlab fig files into LaTeX (especially TikZ). Is ...
9
votes
2answers
4k views

matlab2tikz - TeX out of memory

I am using matlab2tikz to import figures from MATLAB to tex. However I quickly get the message TeX capacity exceeded, sorry [main memory size = 3000000]. I have tried expand main memory using ...
5
votes
1answer
637 views

TikZ to PDF from the command line

I am generating TikZ files using figures from MATLAB (using a MATLAB function from the stack exchange). I then open these files using TikzEdt, and generate the PDF file. Is there a way to make it ...
5
votes
1answer
914 views

Including package to create MATLAB labels using LaTeX

When using LaTeX as the interpreter to typeset labels in MATLAB it would be great to be able to include packages to customize appearance. Is this possible? As of now I know no method to create non ...
4
votes
3answers
5k views

pstool, pdfLaTeX: Not getting pstool to work, “LaTeX Error: File not found”

I've spent lots of hours trying to solve a problem by myself. Unfortunately it seems that no one else has experienced the same problem. At least, searching through various forums and employing Google ...
3
votes
1answer
880 views

Undefined control sequence \text when importing Matlab figures

I'm following a tutorial to import Matlab figures through tikz, however after trying to compile the .tex file I get the following error: ABD: EveryShipout initializing macros (./mysphere.tikz ! ...
7
votes
1answer
866 views

How can I scale a TiKZ image created in MATLAB in my Tex File?

I'm currently having trouble scaling TiKZ figures in LaTeX and wondering if anyone can help figure out what was going on, or suggest a smarter way to do things. I'm currently creating plots in MATLAB ...
6
votes
1answer
711 views

change code font using mcode package

I'm using mcode package to insert into my document matlab code. I would change the default font. what command I should use to get this font?
5
votes
1answer
331 views

matlab2tikz and bar3 function

If I use the function hist3() it perfectly works with matlab2tikz. But if I use the function bar3 I find this in my matrix.tikz: % This file was created by matlab2tikz v0.2.3. % Copyright (c) ...
5
votes
2answers
3k views

Breaking lines in codes with mcode package

I want to include some code from MATLAB and I'm using the mcode package. But the problem I encounter with it is that it doesn't break long lines automatically and since I load the file and not the ...
4
votes
3answers
291 views

How to get listings to print only the header of a Matlab file?

How to extract the first line of a simple matlab file and the following lines just after that begin with the character % ? The number of lines to extract is unknown. Then I want to use listingsutf8 to ...
2
votes
2answers
483 views

Problems with mdframed

I am trying to put a box around matlab code but the bottom of the box sits extremely close to the next line. I try a line break but it does not work. Any ideas? \documentclass[a4paper,12pt]{article} ...
6
votes
1answer
2k views

Setting math font size

MATLAB has the ability to "publish" code as an html document. It can include math by taking equations keyed in LaTeX notation, processing it with latex and embedding a bitmap image into the html. An ...
5
votes
2answers
3k views

Matlab LaTeX Interpreter: Minus sign in subscript or in superscript

In general, using Matlab with the LaTeX interpreter works fine. Today I focus a really stupid bug in the visualization of the minus sign. In Matlab I write a text with the LaTeX string $K_{-1}$ and ...
5
votes
0answers
264 views

Plots from externalized TikZ are rotated [closed]

I just found out about tikzexternalize and I love it - well, almost. This is my situation: I have done simulations in Matlab and used matlab2tikz to get the plots from Matlab into my .tex document. ...
4
votes
4answers
985 views

Matlab to pdflatex with text properties

I know that this might be more a detail rather than a serious problem but I've already Googled it like crazy and I can't find the solution. Is it possible to achieve a MATLAB plot in pdflatex with ...
3
votes
2answers
259 views

Read integers from external data file to document programming code in LaTeX

I am attempting to document my MATLAB programming code in LaTeX. For this, I use the mcode package, which defines the MATLAB lstlisting environment. With the commands ...
2
votes
1answer
146 views

Plotting .dat file

I'm looking to plot a simple plot with data I've taken from MATLAB in a .dat file format. The file has two columns in the order shown below. I would like column 1 to be x and column 2 to be y. I've ...
2
votes
2answers
902 views

Bad font using \psfrag

I'm trying to include a figure that I made in MATLAB. I want to change the font using \psfrag, however there seems to be a problem when scaling the figure down. It keeps the font the same size as the ...
2
votes
1answer
1k views

Minor ticks not showing when using matlab2tikz

I am using matlab2tikz to import MATLAB figures into TeX. However I can't seem to get the x or y minor ticks to show in the document compiled by TeX. The MATLAB figure I have converted to .tikz have ...
0
votes
1answer
179 views

Nearest-neighbour surface plot from matlab2tikz fails with colormap

I load an external custom colormap with \input{coolwarm_.map} I have a range of complex surface plots created with matlab2tikz which use this colormap and compile successfully. One does not. It ...