{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

30
votes
3answers
18k 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 ...
1
vote
1answer
36 views

Turning off/on numbering when using mcode

I have an appendix with a full Matlab script, quoted verbatim, numbered and coloured as I want. However, I want to quote about 10 lines of it as a figure in the body of my report, and since I will ...
0
votes
1answer
48 views

How to force wrap MATLAB code

I'm including a MATLAB script as an appendix in a report I'm writing, I'm using mcode to import it, but some of the lines are longer than the width of my paper. In my master document I have: ...
3
votes
1answer
36 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 ...
0
votes
0answers
78 views

Matlab graphs in Latex [on hold]

I wanted to use Matlab plot into Latex , i did some search and I found matlab2tikz, but when i've followed matlab2tikz tutorial , i got an error Could some one show me how i use matlab2tikz or is ...
4
votes
1answer
79 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: ...
10
votes
2answers
236 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 ...
6
votes
2answers
314 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, ...
2
votes
1answer
132 views

MATLAB Plot Alignment in latex

I have two plots in which the x-axis are the same and I'd like to have the y-axis positions to be aligned. As the numbering of the y-axes are different when I print them in MATLAB as two eps files, ...
6
votes
1answer
323 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 ...
2
votes
1answer
191 views

Problem with xticks when importing Matlab figures using matlab2tikz

When importing the following figure using the Matlab2Tikz, I obtain the following output , with the xticks strangely exported . Does any one have an idea how I can prevent this? Maybe by passing ...
2
votes
2answers
138 views

doing 3x3 subplots with the colorbar located northside

I wanted to have my nine (2d) matlab plots shown as 3x3 subplots in latex with the colorbar located northside. I have no idea how to do this especially that I have the colorbar saved separately from ...
2
votes
0answers
80 views

using sublime 3 to install matlab-prettifier package from ctan library [closed]

How do I use Sublime Text 3's built in package manager to install packages from ctan? I am trying to install and use matlab-prettifier in a latex document class report. I manually downloaded, compiled ...
7
votes
2answers
249 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 ...
4
votes
3answers
229 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 ...
0
votes
0answers
61 views

matlab2tikz not maintaining subplot dimensions

The following Matlab script gives me the two plots of the time series object T204 a1=subplot(3,1,[1,2]) plot(T204) a2=subplot(3,1,3) plot(T204) It looks like this in Matlab: Then I use ...
0
votes
1answer
122 views

Best practices for using MATLAB images in LaTeX?

I am writing a paper currently using PDFTEX, and I make heavy use of MATLAB figures. The problem is that when I make a MATLAB figure, I can adjust it to any size, before saving it. When I save it, I ...
1
vote
1answer
73 views

Matlab2Tikz Error with userdefined matlab colors

I try to include from matlab exported (matlab2tikz) tikz files into latex, but get error messages if i don't use matlab default colors. I don't get the problem?! Thanks you guys in advance Error: ...
2
votes
1answer
109 views

How to programmatically coax pgfplots to recognize nan within surface as matlab does

I came across this post after wondering why nan's did not appear to be handled by pgfplots as they are by matlab when working with the matlab pcolor function. My typical workflow in this context is: ...
3
votes
0answers
123 views

Figures (pdf) do not contain any text in the final document [closed]

I am creating some plots in Matlab and saving them as pdf files. When I include these pdf files in latex (i am using MikTex and pdflatex) using \includegraphics, all text from plots (legends, xlabel, ...
3
votes
2answers
99 views

Listings problem with quotes in a string

A single quote occuring inside a listings string seems to be interpreted as ending the string. Is there a way to avoid this from happening? \documentclass[12pt]{article} \usepackage[top=0.3in, ...
44
votes
4answers
5k 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?
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 ...
2
votes
1answer
88 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 ...
4
votes
0answers
95 views

eps import wrong title in graphic \pi looks like \neq

Need to import a figure from Matlab. I export it as an eps and use epstopdf to import it in latex for some unknown reasons the greek pi in the title of the plot that looks ok in the .eps does not ...
1
vote
0answers
139 views

Importing plots from MATLAB to LaTeX

This is my first time trying to import plots created by MATLAB into LaTeX and it's not turning out very nicely. I have saved my MATLAB plot as a .png file here and an .eps file here. Using the .eps ...
2
votes
1answer
605 views

Matlab->plot2svg->Inkscape->pdf+latex->includesvg = slow rendering pdf + large file. How to solve that?

I have the following workflow. I use matlab to produce 3D plots with transparency and I want to use the workflow of setting the text inside the figure in latex. I am using Texniccenter and MikTex the ...
4
votes
1answer
882 views

Dimension too large after exporting box plot with matlab2tikz

When exporting a box plot with matlab2tikz I get no errors, but when running pdflatex I get a "dimension too large" error. This only happens with box plots. Still the box plot shows up as it should, ...
4
votes
1answer
191 views

Draw lines inside tikz plot (exported from matlab), independent of coordinate system

I am exporting plots from matlab with the matlab2tikz package. While this works just fine, I now want to insert some lines and text to describe the plot. I have multiple plots which are to be labelled ...
4
votes
2answers
125 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 ...
9
votes
2answers
3k 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 ...
1
vote
0answers
26 views

Using mcode within a beamer frame [duplicate]

I have a presentation that I would like to include some matlab code in. For that purpose I have included the mcode package, that basically configures the listings package. My problem is that the ...
7
votes
1answer
10k 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? ...
5
votes
3answers
2k 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 ...
1
vote
0answers
203 views

error:out of memory error in matlab [closed]

I am trying to write a matlab code for image morphing . I have to prewarp the images first , i have used imwarp function with the tform as follows , the code is , function []= ...
0
votes
0answers
152 views

font in MATLAB figures (type1 / type3)

I have some figures generated in MATLAB. I want to include the figures in a tex file. First I save the figure as eps format. and then I include the eps file in the latex. The default font of the ...
7
votes
1answer
182 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 ...
2
votes
0answers
161 views

Greek-Letters-Different in AdobeReader and TexStudio, who's right?

I want to use greek letters in my Matlab Figures and then use the figures in Latex. I'm using TexStudio, and the preview inside of TexStudio shows me, for example if I entered a \mu in Matlab ...
1
vote
0answers
286 views

LaTeX TiKz Matlab - Marker Colors in Scatter Plots [closed]

I create a figure in Matlab, then export using matlab2tikz, then compile everything in a LaTeX document. The problem I have is tikz changes the color of the markers specified in Matlab. For instance ...
1
vote
0answers
371 views

Problems converting matlab figures to pdf using /psfragfig

I am trying to include MATLAB figures as pdf files in my thesis. However after reinstalling my OS this doesn't work anymore and I am desperately trying to find a solution... What I do: I use the ...
0
votes
1answer
173 views

TikZ legend changes the line legend into a rectangle legend

I am using TikZ to insert MATLAB figures but the problem is that I have two legends one is a line and the other is a rectangle. When I insert it, both look like a rectangle. How should I correct it ?
4
votes
2answers
193 views

How to include graphics?

I have some Matlab code that produces some diagrams. All I want to do, is to import these diagrams into TeXmaker. In which format do I have to save these diagrams and what packages do I need for this ...
1
vote
1answer
177 views

Remove whitespace in plot in Matlab textstring where 'DefaultTextInterpreter' is 'Latex'

With MWE: set(0,'DefaultTextInterpreter','Latex'); x = linspace(0,10,1e2); fx = sin(x); Xpos = 0.1; Ypos = 0.83; plot(x,fx); hTag = text(Xpos,Ypos,'(a)'); set(hTag,'FontSize',23); I get (too much) ...
2
votes
1answer
301 views

Disappearing Euro symbol in MATLAB EPS plots

I have a problem using eps images in LaTeX. Briefly, I have a plot from MATLAB were a label on an axis is "€". I insert this image in my tex file, then, when I compile, on the pdf the "€" disappear. ...
5
votes
1answer
482 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 ...
0
votes
1answer
627 views

label font size in matlab->matlab2tikz

Does anyone knoy how can we increase the labels fontsize when we use the matlab2tikz (see this link) function from the mathworks file exchange? I always have to access the *.tikz generated file and ...
0
votes
0answers
265 views

How to import SVG or EPS files with LaTeX legends on Inkscape?

I usually plot my functions using Matlab or Python (matplotlib) and set labels with LaTeX. Occasionally, the plots have some rendering problem and I edit their SVG or EPS files using Inkscape. The ...
2
votes
2answers
790 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 ...
1
vote
0answers
42 views

Matlab Laprint and jpg,pdf figures [duplicate]

For my thesis I would like to have the best quality and therefore I use laprint.m this generates an EPS and TeX file of my figures from Matlab (R2007b). The following is installed on my computer ...
1
vote
2answers
487 views

3D as 2D plots using Matlab data

I am trying to plot 3d data as 2d (please refer to the attached figure). Is that possible at all in Tex (or Matlab)?(Usually, this is done a s a legend, however, when no colors are allowed, I have to ...