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
1
vote
1answer
17 views

How can I add string formatting for listings code?

How do I make sure that string-like code like "file" below (on line 7) gets same formating (purple/muave) like strings below? \documentclass{article} \usepackage{verbatim} % code \...
0
votes
1answer
50 views

two column document figure over entire page

I have a document with two columns, I want to insert a figure that is as wide as the entire page (not only in one column). my figure is a matlab graphic in .eps format. I use \usepackage{multicol} {2} ...
1
vote
0answers
40 views

Removing scientific notation of y-axis

Hello fellows and folks! 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 ...
2
votes
0answers
44 views

MATLAB to LaTeX eps file glitches and problems

My question is about including MATLAB exported images in LaTeX. I need it to be a vector graphic image. I have spent a lot of time trying to search for an answer. It is with great hesitation that I am ...
1
vote
1answer
51 views

Bar Chart - Change Face Color Separately For Every Single Bar

I am using Matlab's bar command to create a bar-chart. I am using matlab2tikz to convert it. I would like to change the face color of every single bar separately to an rgb color of my choice. In ...
0
votes
0answers
46 views

Update Matlab graphics in Overleaf

I was told that it is possible to link a Matlab script with an Overleaf account such that output of any form (figures, tables and data) can be updated and imported everytime a Matlab script is ran. ...
0
votes
0answers
20 views

Matlab2tikz: Multiple Column Legend

I am creating a Matlab figure with multiple columns using the legend command: legend('DataX1','DataX1','NumColumns',2) This will give me a figure such as: Now I would like for this figure to be ...
0
votes
0answers
13 views

Problem with \psfragfig

In order to import a graph from MATLAB into pdflatex, I used \matlabfrag and \psfragfig. The pic shown below is what I get. The Font size is good enough, but the plot size is small. How to make the ...
0
votes
1answer
61 views

Putting purple color to MATLAB font and code structure [duplicate]

I have this MATLAB code: After sysms the variables turn purple and I cannot make that in the MATLAB script I have in Latex: \documentclass{article} \usepackage[T1]{fontenc} \usepackage{bigfoot} % ...
1
vote
0answers
18 views

Matlab's script losing identation when pdf is generated. How can i solve it?

i am new in all this Latex stuff, but i am trying to learn. Currently i am stuck in a problem: display a Matlab code. This is my code in TexStudio: \documentclass[12pt]{article} \usepackage[margin =...
1
vote
1answer
20 views

Problem with Chapterbib and Matlab-prettifier

I am trying to insert a Maltab code in a Latex document using Matlab-Prettifier. I am configuring the package as indicated below: \usepackage[framed]{matlab-prettifier} \lstset{ style ...
0
votes
0answers
20 views

Listings weird charater behaviour

I am trying to put in MATLAB code with comments that contain my language charaters thought they are covered under ANSI chars they jump to word begining in comments. Heres the code. Its basically ...
0
votes
0answers
62 views

3D Polar Plot in sperical coordinate system in PGF/Tikz - Matlab2tikz fails, me too. (CST MWS Antenna FarField pattern)

I have simulated an Antenna in CST and want to plot the 3D pattern. The resolution is fairly low with a step size of 20°. Matlab2tikz won't help because it creates huge PDFs (60kB tex file to 5MB ...
1
vote
2answers
90 views

I want to add only one line of Matlab code in latex

I wan to show which command line I have used for some specific result. for example i want to show this line 'for i=1:100' in between text. I am using listing environement. \documentclass[hidelinks, ...
0
votes
0answers
24 views

Add a matlab script(m.file) into Latex: error with text-overflow ( edit 2)

I am trying to add an appendix with Matlab scripts in my thesis. I have used the post about it here. In my main.tex I have added: \usepackage[T1]{fontenc} \usepackage{bigfoot} % to allow verbatim in ...
1
vote
1answer
28 views

MATLAB code in Overleaf compiles as Greek instead of English

I'm writing a document using Overleaf. The main language I'm using is Greek. The Greek shows up fine but when I try to enter Matlab code using the package listings, it shows up as Greek in the ...
0
votes
1answer
95 views

Latex cant read from my .dat file

I wrote a .dat file from Matlab. this data has 8 columns each having 1x101 values. \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{pgfplots,tikz,graphicx} \title{ Experimental ...
0
votes
0answers
93 views

.epsc file changes color when compiled

My situation is quite specific and requires Matlab to replicate. I have an .eps file generated by heatmap in Matlab. Underneath the color bar is a legend for NaN values. I have customized the ...
1
vote
1answer
52 views

How to make the list of listings to work properly in tex4ebook?

How to make the list of listings to work properly in tex4ebook? Commands \tableofcontents and \listoffigureswork correctly. The pdf result The epub result I didn't found any suggestion to ...
1
vote
1answer
75 views

Using matlab prettifier to put 100 lines of code per page

I need to put my code for a software I have written in my thesis appendix. There's about 4000 lines of code across multiple files, so I'd like to have 100 lines of code per page. Using these settings,...
0
votes
1answer
122 views

Formatting Matlab file with lstlisting

I included a Matlab file, and it worked fine. The colors changed and it looked nice. Suddenly Latex doesn't change the colors of the code, except of the background color. Is something wrong with my ...
0
votes
0answers
222 views

Latex does not compile eps files form Matlab? [duplicate]

I have problem with inputing eps files from Matlab in my latex document. Matlab version is R2016a. Windows version is 10, editor is Texmaker 5.0.3, MikTeX is version 2.9. The first case is when I ...
0
votes
0answers
31 views

Highlighten specific x-axis values

I need some help to plot a small figure for my thesis. I know that the question is towards Matlab, but I export the figure as a tikzpicture and genuinely think that you guys deliver the better ...
1
vote
0answers
551 views

MATLAB Font in LaTeX [closed]

I want to write a single command from MATLAB in LaTeX using the MatLab font. I have found a lot of examples using listing, but that is for the whole code. I only want to change the font for one word, ...
0
votes
0answers
15 views

error while using diacritical marks in matlab code in latex [duplicate]

I'm very new to latex and I'm trying to write a latex document in polish. It contains diacritical marks such as "ą" or "ś" and it all works fine until I try to add some Matlab code to the document. My ...
0
votes
0answers
49 views

Extract EPS file data for PGF plot

For our project this semester we have to make a scientific paper and poster. To keep the poster nice and uniform we are using PGFplots for our graphs. One problem though is that MATLAB Simulink can't ...
0
votes
0answers
39 views

Wondering how Latex will be useful for me in specific application

I've a monthly report that I need to submit and I currently use Matlab to compile all the data that I place into the report. I then take this data and manually comment and display it in a word ...
0
votes
1answer
135 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
250 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
50 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
43 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
75 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
129 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
96 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)$', '...
2
votes
3answers
389 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
106 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); \...
2
votes
0answers
137 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
392 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
174 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
71 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
104 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
183 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
277 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
546 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
300 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
281 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
191 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
861 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
246 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
216 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
2 3 4 5 6