Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [matlab]

{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 algebra) based storage and calculations.

5
votes
1answer
64 views

Listings color context sensitive keywords (Matlab)

In Matlab there's two ways to use end: to end ifs, whiles etc. to refer to the last item in an array/vector (example: v(end) or v(end-1)). I want to use listings to include some matlab code in my ...
1
vote
1answer
26 views

Update LaTeX document content with the parameter values of a Matlab model

I have a Matlab model with some parameters ( a=1, b=2, c=3, etc). I want this values to appear "automatically" in my LaTeX document and when they are changed in the Matlab code they are in the LaTeX ...
0
votes
0answers
35 views

Matlab2tikz // Error divsion by 0.0

I created a minimal working example in Matlab: [x,y] = meshgrid(-2:0.1:2,-2:0.1:2); fx = x.*y; fy = x.*y; figure quiver(x,y,fx,fy) matlab2tikz('plot.tex'); This works great and creates the plot....
0
votes
0answers
43 views

Minted tango theme indentation

The following mwe shows the problem I am facing: \documentclass{article} \usepackage{minted} \begin{document} \usemintedstyle{tango} \begin{minted}{matlab} function test() i = 1; j = 1; end \...
0
votes
0answers
112 views

Matlab code in latex

I want to put matlab code into my latex document and I saw this post. However, I don't really see how this works. I entered the following code into my overleaf account : \documentclass{article} % ...
0
votes
1answer
132 views

Side-by-side subfigures, MATLAB export, textwidth

EDIT: This might be solved with just the knowledge of what size \textwidth in points or centimeters is with this setup. I have the problem of exporting MATLAB figures to LaTeX and keeping the font ...
4
votes
1answer
129 views

Change font size in matlab2tikz

I am using matlab2tikz to export my Matlab figures in order to be able include them in my LaTeX document. I think the fonts of the tick labels, axis labels, titles and legends are too big. How can I ...
0
votes
1answer
163 views

Handling nan's with pgplots/matlab2tikz

I am currently developing some simulations using a nonlinear model w/ feedback in MATLAB where there exist some trajectories that are unstable. I want to export this using matlab2tikz so I can have ...
3
votes
2answers
77 views

How do I stop matlab-prettifier thinking print strings are comments?

I am trying to put my code into a Latex document using matlab-prettifier. I am doing this by using \lstinputlisting[style=Matlab-editor]{Trap.m}. An example of Trap.m (a MATLAB file) is as follows ...
6
votes
3answers
605 views

How to highlight a portion of Matlab Code

Consider following code posted for What can I use to typeset MATLAB code in my document? \documentclass{article} \usepackage[T1]{fontenc} \usepackage{bigfoot} % to allow verbatim in footnote \...
3
votes
0answers
192 views

capacity exceeded when matlab-code is included

When I run my code in TexStudio I obtain the error capacity exceeded I have the following code % !TeX program = xelatex \documentclass[fromlogo = true,a4paper]{article} %\documentclass[a4paper]{...
0
votes
0answers
188 views

eps exported graph from matlab

I dont know what is the problem with the eps graph exported from Matlab, when i do the run the figure is not in its position as seen below \documentclass[a4paper,12pt]{article} \usepackage{...
1
vote
2answers
422 views

German letters Ä Ö Ü ß with Matlabcode

Edited 16.05.18 17:55 Added the Matlab-code I want to compile. Adding I managed to compile the german letters Ä, Ö, Ü, ß in my Matlab code via listings, but now these letters fail to be compiled in ...
1
vote
0answers
122 views

Minted vs matlab-prettifier for thesis [closed]

I am writing my PhD thesis now for which I need to list snippets of source-code within the main text and full listings in the appendix. I did my coding entirely in MATLAB using advanced constructs ...
0
votes
0answers
34 views

Add source code from multiple files into thesis [duplicate]

I am currently writing my thesis in Latex. I am supposed to include the source code in the appendix. I know that I can include code as listings into my text. Since my code is spread along multiple ...
0
votes
1answer
96 views

Can't get Bera font with Matlab-prettifier

I've used Matlab-Prettifier in the past to format my Matlab code, but having moved out of ShareLaTeX and into a local environment, I can't seem to get the Bera Mono font. E.g., the code ... \...
1
vote
1answer
796 views

Is there a way to converting matlab codes to latex?

I have some complicated codes and I want to convert them in equation format. After that, I will write them using LaTeX. I am sharing following part of code: Dx = hypot(bsxfun(@minus,x,x'),bsxfun(@...
3
votes
1answer
74 views

numbering isn't showing with matlab-pretifier package

does anybody know why this might be? I tried changing my document class from "Article" to "Beamer" and also tried deleting a bunch of packages but nothing has made the numbering on the Matlab-editor ...
3
votes
1answer
136 views

Pgfplots and MATLAB provide different results

I need to plot a function using pgfplots, but the result is different from the expected. The domain should be 0:1. \documentclass[tikz]{standalone} \usepackage{pgfplots} \begin{document} \begin{...
1
vote
0answers
276 views

Nordic characters in matlab code

I'm new here and pretty new to LaTeX, so go easy on me. I'm importing MATLAB code from .m files using \lstset{language=Matlab}, but have some trouble with nordic characters "å, ä, ö". the rest of the ...
1
vote
0answers
46 views

Pdflatex behavior when a picture is missing [duplicate]

Say I have a simple LaTeX file to compile (missingPic.tex) but a picture is missing. The following would be a MWE \documentclass{article} \usepackage{graphicx} \begin{document} We now include a non ...
2
votes
2answers
1k views

Convert latex math to matlab math?

This may seem like a weird question, but the reason I'm asking is as follows. If I type a long list of equations in latex, and then want to turn them into matlab expressions, I basically have to ...
0
votes
0answers
527 views

EMF figures in LaTex

I am slowly learning and shifting to latex. Figures I have produced till now are all .emf format and now I am unable to load them into latex. Kindly suggest what could be done. Please do not suggest ...
2
votes
1answer
168 views

Issue with listings and standalone packages

I am writing a document using multiple files. I've been using the standalone package without any problem until today. I need to create an appendix chapter containing some Matlab code, so I decided to ...
3
votes
1answer
253 views

Cross-referencing equation in MATLAB code for LaTeX Publishing

I'm currently working with my team to write our capstone report. We need to use MATLAB code, and since we're using LaTeX to write our report, we also publish our code to LaTeX and include it in ...
0
votes
1answer
2k views

I can't use acute accents (Latex interpreter form) on Matlab

I intend to use an acute accent on a letter, for example, "é", inside a legend of a Matlab graph which uses a LaTeX Interpreter form. In Latex code we can write "é" using \'{e}. On Matlab the ...
1
vote
1answer
309 views

after executing matlab2tikz legend is incomplete

Hello i'm a bit desperate. As nobody seemed to care about my last post i tried a lot on my problem but i still couldn't find the solution. I want to use matlab2tikz to include my matlab figures into ...
1
vote
0answers
67 views

Why doesn´t this new environment work? [duplicate]

I´m using the Matlab-prettifier package to include Matlab-code in my Latex-file, and it generally works, i.e, when I´m using the custom environment from the package: \begin{lstlisting}[style=Matlab-...
1
vote
2answers
3k views

How can I insert a Matlab code in Lyx easily

I have a .m file with Matlab code and I want to paste it in Lyx. How can I do this easily?
0
votes
0answers
51 views

Recognize fonts [duplicate]

I am using the Latex interpreter for the figures, which I create and save as a .eps-file in matlab. The problem is that I want to change some names of the labels of the axis in these .eps files and I ...
1
vote
0answers
165 views

Recognize LaTeX font in Inkscape [duplicate]

I am using the Latex interpreter for the figures, which I create and save as a .eps-file in matlab. The problem is that I want to change some names of the labels of the axis in these .eps files and I ...
2
votes
1answer
159 views

How to get matlab plot in .eps format into the latex using epstopdf?

I want to enter my matlab plot into LaTeX. I am using the graphicx and epstopdf packages. But when I tried to make a pdf, the pdf was not created. It shows a blank page and the following warning: ...
0
votes
0answers
343 views

Automating the formatting of Matlab table outputs into a TeX document

I am using Matlab table to create tables with my descriptive statistics. A typical table looks something like: I can write this table to a perfect excel file using the function writetable as follows: ...
4
votes
1answer
1k views

How to produce this Matlab social network graph from an adjacency matrix in Tikz

I have a social network graph that I have made in Matlab using the graph object: G = graph(weight); LWidths = 10*G.Edges.Weight/max(G.Edges.Weight); h = plot(G,'NodeLabel',cellstr(screen_names),'...
3
votes
1answer
199 views

Hyphenated subscript term in Matlab

Around 2014, the LaTeX engine Matlab uses was modified significantly. As a result, I believe there is no longer a way to use the amsmath package from within Matlab. Without the amsmath package, ...
1
vote
0answers
177 views

Displaced text when importing eps

I have a problem with my MATLAB plots. I need to use tikz/pgf created figures and display MATLAB plots where I want the font and fontsize to be equal in all figures even if I change the size of the ...
0
votes
1answer
250 views

pstool, psfragfig and matlabfrag ambiguity

I am trying to use matlabfrag package in order to use pdflatex along with pstool. There is some kind of a strange issue which I could not understand. I exported some figures from MATLAB with the ...
2
votes
1answer
507 views

Matlab result as animation in Beamer

Some pdfteX slides include some matlab plots as animation using a window like the following using which, one is able to go forward and backward, pause, or and change the speed. I would like to know ...
2
votes
2answers
3k views

What is the best way of including Matlab code in a LaTeX document? [duplicate]

I know this is a popular problem. I have read that the matlab-prettifier package yields good results. My Editor told me, I am missing this package, though. I don't know how to download the package to ...
3
votes
1answer
639 views

How to scale a matlab graphic and include it in LaTeX using matlab2tikz

I have created a Matlab graphic. Now I want to use matlab2tikz in order to include the graphic in a LaTeX document. Therefore, I scale my graphic in Matlab, using: %LaTeX set up height=10; width=10;...
3
votes
0answers
337 views

How to make the axis labels of a Matlab graphic appear bigger in LaTeX

I have included a Matlab.eps in my LaTeX document. But for some reason the axis scaling and also the labels of my axes are really small - I mean the writing is so small, I can barely read it. I don't ...
1
vote
1answer
629 views

How to include a MATLAB (.eps) graphic

Can somebody give me a step-by-step guidance of how to include my .eps graphic, which I have created with MATLAB, in my LaTeX document? I have heard of matlab2tikz, a script which is available on ...
2
votes
1answer
135 views

MATLAB eps output converted using MiKTeX's epstopdf wrongly displayed in Acrobat Reader

This question does not contain any direct reference to TeX; however, I came across the problem while working with pdflatex, specifically when including eps output into a pdf file. Also, I expect the ...
1
vote
0answers
168 views

Matlab2tikz problem [closed]

I have used the matlab2tikz package from http://se.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz-matlab2tikz for some time and never had any serious problems with it. Until now; ...
3
votes
2answers
273 views

Problem with encoding of inserted .m-file

Sorry for an ugly post, it's my first one & I have very little time. I have this tiny document on overleaf: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[polish]{babel} \...
-1
votes
0answers
108 views

Turning a dot picture into a nice picture using tikz

I am interested in the best method for turning a picture made up of dots into something that looks a lot nicer. Essentially, I have a function that f(x,y) that produces integer values for each value ...
2
votes
1answer
561 views

Matlabfrag figure in latex

I have been trying to figure out the best way to include vector plots from Matlab in Latex. I rounded on to matlabfrag, which is relatively straight forward compared to matlab2tikz. Somehow, I am not ...
1
vote
0answers
167 views

Matlab plots 2 tikz. Axis collapse [closed]

I'm writing my thesis, and it seems I need to convert all my images to tikz and include them in my TeX file. I used matlab2tikz command to convert the plots to tikz. It was not that hard, but there ...
0
votes
1answer
136 views

Error while using Verbatiminput

I have the following Error in my .log-File: ! Text line contains an invalid character. <read 1> { Undefined function or variable 'generateFilename'. l.80 \verbatiminput{MasterFile....
4
votes
1answer
2k views

MATLAB Command Window Output

I want the Matlab code output to be printed in my LaTeX file. What is the best and most efficient way to do that? Export results as .txt and then call it in LaTeX or are there other (better) methods ...