{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

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?
37
votes
10answers
24k 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?
34
votes
3answers
23k 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 ...
34
votes
11answers
25k 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
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 ...
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 ...
12
votes
1answer
7k views

Using listing for displaying Matlab code

I'm trying to display matlab code in a LaTeX document and the comments are typeset with an ugly space between letters: \documentclass{article} \usepackage{listings} \lstset{language=Matlab} ...
11
votes
8answers
3k 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 ...
11
votes
2answers
2k views

Octave to LaTeX

Is there anything (command/script/function) that can convert a Octave expression to LaTeX. What I am asking for is something like this: I type a = eye(3,3); %Identity Matrix and then do something ...
10
votes
2answers
320 views

How can I hide (or blur) some code in a listing?

I have a code listing to write in a report, but I'd like to blur or hide some code parts with a colored box (of same length as the hidden text), so that readers cannot see the hidden parts. (Another ...
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 ...
8
votes
3answers
1k views

draw Fourier Series Expansion with tikz/pgfplots

This is a MATLAB code T=0.3; A=0.3; t=0:0.01:4*T; n1=length(t); N=100; s=0; signal=0; for i=1:n1 s=0; for n=1:N s=s+A*4/(pi*(2*n-1))*sin(2*pi*(2*n-1)/T*t(i)); end signal(i)=s; end plot(t,signal); ...
8
votes
1answer
956 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 ...
8
votes
0answers
318 views

Help on adjusting histogram plot created by TikZ [duplicate]

I am trying to create a tikzpicture similar to what I have made in MATLAB. MATLAB gives me the following result after running histogram: myhistnorm = [ 0.1231 0 0 0 0 0 0 0.0001 0.0001 ...
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 ...
7
votes
2answers
321 views

Plot and imagesc (from Matlab) with PSTricks

I'd like to plot with PSTricks some data from Matlab. I usually plot these data using the imagesc and the colorbar in Matlab, but I'd rather do it in LaTeX... Here is the picture I want to plot in ...
7
votes
1answer
207 views

How can I typeset Julia code with the listings package?

I'd like to typeset some Julia code, syntax highlighting and all, with the listings package. For information, the Julia language is a strong contender for MATLAB, and is free and open-source. ...
7
votes
3answers
3k views

Removing scientific notation in tikzpicture made by matlab2tikz

I am having a very hard time trying to figure out how to remove the scientific notations on the y-axis of my graphs. The graphs are made in MATLAB and then converted into TikZ files using the package ...
7
votes
2answers
165 views

Adding styling to LaTeX produced by MATLAB

MATLAB has a function called publish which has the option to export a script and its output as LaTeX. It looks quite nice, although there are a few additional things that I would like to do to the ...
7
votes
1answer
15k views

How can I insert latex symbols into a matlab plot?

I have a figure in matlab with axes that I would like to label with latex symbols like $\delta$ on the x axis and $\epsilon$ on the y axis. How can I place these latex notations into the axis labels? ...
7
votes
2answers
830 views

Including published Matlab code and figures in separate LaTeX document

I'm writing up a homework set in LaTeX. I'm writing the theoretical parts of the homework using LaTeX, and the implementation in Matlab. I want to combine these two easily. My problem is: How do ...
7
votes
1answer
908 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 ...
7
votes
1answer
302 views

Reverse graphics in pgfplots

Issue and Question I encountered that my graphics are all upside down. Now I have to mirror them in pgfplots. How can I perform this step? It is no solution using the option [y dir=reverse] which ...
7
votes
1answer
1k views

.eps file generated by matlab not centered correctly

Everything is all right before I updated all my MiKTeX package to latest version. But after that, I find that all .eps file generated by Matlab cannot be shown correctly. For example. I use Matlab to ...
6
votes
1answer
385 views

How can I get proper Matlab syntax when typesetting Matlab source code using the algorithm package?

I'm currently using the algorithm package for typesetting Matlab source code in my document. However, the way keywords are typeset doesn't match the Matlab syntax. For instance, \EndFor is typeset as ...
6
votes
1answer
86 views

What is the difference between \usepackage{mcode} and \usepackage{listings} for MATLAB codes?

I know there is available in the MATLAB Central File Exchange site the mcode.sty package, which allows to put MATLAB codes into TeX files. ...
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 ...
6
votes
2answers
151 views

Input Auto-Generated Figures Captions

I'm trying to include an Matlab-auto-generated figure-caption tex-file using \caption{\input{Spectrogram-2011-09-28-S003.title.tex}} but if fails with error ERROR: Argument of \@caption has an ...
6
votes
2answers
411 views

A\b Using mcode package

How do I typeset "x=A\b" in mcode, which represents "matrix division" in MATLAB? Here is a MWE: \documentclass[12pt]{report} \usepackage{amsthm,amsmath, amssymb, paralist, fancybox, listings, ...
6
votes
1answer
854 views

Problem about program code included in LaTeX

I have some Matlab code which I would like to include in my LaTeX document. I use fancyvrb package, based on which I define a new environment called code. An complete and minimum example is: ...
6
votes
1answer
740 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
2answers
692 views

Getting rid of \vspace{1em} from MATLAB LaTeX publish

When publishing an m-file from MATLAB to LaTeX, a vertical space of 1em is inserted after each text paragraph. I frequently input these published files directly into a master document by using the ...
5
votes
2answers
246 views

How to draw 3d vector field on a line?

How to draw 3d vector field on a line? I want to visualize the vector field $( m_x(x), m_y(x), m_z(x) )$. After searching "visualize vector field", I find that most plotting software either plotting ...
5
votes
1answer
681 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
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 ...
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 ...
5
votes
1answer
344 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
1answer
322 views

The % symbol overlaps inside a listing with MatLab code

I'm using the listings package to insert MatLab routines that I've created for some papers I need to write. Everything works awesome, except the symbol % (comment in MatLab) which overlaps with the ...
5
votes
2answers
833 views

Tikz-pgfplots and matlab2tikz doesn't capture subplots well

I use matlab2tikz to convert this matrlab figure: % This file was created by matlab2tikz v0.3.3. % Copyright (c) 2008--2013, Nico Schlömer <nico.schloemer@gmail.com> % All rights reserved. % ...
5
votes
1answer
1k views

How to sweave Matlab or Mathematica code into LaTeX.

There is a package called pgfsweave for R. It can sweave R code into a LaTeX document. I found we can gain some advantage from this method. The report document can reproduce. The font in figure ...
5
votes
1answer
2k views

Export eps figures modified by psfrag

I am not an expert on figure exports and, although I have been searching around quite a lot, I can't find the answer to my problem. During the writing of a journal article, I had the idea of using ...
5
votes
1answer
944 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 ...
5
votes
2answers
4k 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
265 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
2answers
181 views

clash between mcode and scrbook

I want to include Matlab code in my document. The mcode package used to do a great job in combination with my scrbook document class. However, I recently updated my KOMAscript family to version 3.12 ...
4
votes
3answers
312 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 ...
4
votes
4answers
998 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 ...
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 ...
4
votes
1answer
2k views

Problem using matlab2tikz

I'm trying to get matlab2tikz to work. I want to use it for prettyfying output of Matlab's image() command. In Matlab I tried imagesc(rand(100)); xlabel('X'); ylabel('Y'); title('Random Colors'); ...
4
votes
1answer
149 views

What can I do if a listing is too wide to fit in my two-column document?

I am writing a IEEE document with a LaTeX template I downloaded from the IEEE webpage. I inserted some MATLAB code into the document through the mcode package. It looks something like this: ...