The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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.

Filter by
Sorted by
Tagged with
0
votes
1answer
32 views

Matlab histogram converted to Latex makes blurry image

I´am trying to import a matlab histogram to latex. So I generated the plot and saved it with print -depsc MyPicture. Afterwards I loaded the .eps File with \includegraphics[width=.8\textwidth, ...
1
vote
1answer
44 views

Text in image scaled to same size as body text

I am working on a research submission and my supervisor requires that any text on my graphs (e.g. axis labels, tick marks etc) are the same size as text in the main body of my report (including ...
1
vote
1answer
32 views

Have listing package recognize Matlab comments coming after “…”

In Matlab, ... means that a statement is continued on the next physical line. Any text coming after the ... is a comment. Is there any way to have the listing package recognize the comments coming ...
0
votes
0answers
27 views

Converting Matlab arrays to LaTeX compatible Code with special format

I have a Matlab array of dimension 40X12. The array is a little bit special. All the odd row is expressed as scientific expression, while the even row is not. For example, the first row can be [3.5e-4,...
0
votes
0answers
25 views

Latex problem with eps figures generated with Matlab

I have generated eps figures for my article which encountered problem with Latex. When I compile it with Latex --> dvi , The figure on the left side does not appear properly as can be seen in the ...
0
votes
1answer
50 views

Surf plot with tikz

I am trying to regenerate a surf plot from Matlab using 3-d-plot of tikz. The graph should look like this: But with my code: \documentclass[]{article} \usepackage{pgfplots} \usepackage{pgfgantt} \...
0
votes
1answer
49 views

correct way of writing the units on a graph [closed]

What font should I use in Matlab for having the same one like in LATEX? What is the right way to have the units on a graph? use () or [] for unit of measurement? a or b? a. xlabel('$C (fF)$', '...
0
votes
1answer
69 views

Matlab plot Latex style

I would like to have the units on the axis from a Matlab plot with the correct form like SIunitx in LATEX. Is this possible? This is the line that I would like to have different: no u, but μ. ...
2
votes
1answer
37 views

Why are strings interpreted wrong in MatLab code with listings

I am trying to include MatLab code in my document using the listings package, but it seems like strings are not interpreted correct. fprintf('ABC %s:\n', mystring); fprintf("ABC %s:\n", mystring); \...
1
vote
0answers
80 views

Filled contour with Matlab data, pgfplots

I'm using contour prepared format=matlab to plot a contour, as sugested in pgfplots manual, but I'm not able to combine it with the contour filled option. I've modified the C data from [C,h]=contourf ...
1
vote
0answers
77 views

Matlab live script translation to latex within latex

Matlab has its own way to format text inside an *.m file --- if you open that *.m file as a live script it would format the whole-line-comments as text (see example). For this there are a set of ...
5
votes
1answer
90 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 ...
0
votes
1answer
33 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
56 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
89 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
227 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
261 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
198 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
224 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
118 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
710 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
218 views

capacity exceeded when matlab-code is included [closed]

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
204 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
705 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
159 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
1answer
125 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
2k 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(@...
2
votes
1answer
99 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
177 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
329 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
48 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
2k 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
706 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
216 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
322 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
400 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
68 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
4k 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
53 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
199 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
179 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
442 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: ...
3
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
256 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
213 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
277 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
599 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 ...
2
votes
1answer
702 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;...