Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using bodeplot #1127

Open
maritimeLabKiel opened this issue Sep 27, 2023 · 1 comment
Open

Error when using bodeplot #1127

maritimeLabKiel opened this issue Sep 27, 2023 · 1 comment

Comments

@maritimeLabKiel
Copy link

When I use the Matlab bodeplot() function and call matlab2tikz(), I get the output

Index exceeds the number of array elements. Index must not exceed 0.

Error in matlab2tikz>makeTable (line 5614)
    if ~all(nRows==nRows(1))

Error in matlab2tikz>drawPatch (line 2372)
        [m2t, facesTable] = makeTable(m2t, repmat({''},1,size(Faces,2)), Faces);

Error in matlab2tikz>handleObject (line 3094)
    [m2t, str] = feval(actualHandler, m2t, h, custom);

Error in matlab2tikz>handleAllChildren (line 683)
                [m2t, str] = handleObject(m2t, child, @drawPatch);

Error in matlab2tikz>drawHggroup (line 3029)
            [m2t, str] = handleAllChildren(m2t, h);

Error in matlab2tikz>handleObject (line 3094)
    [m2t, str] = feval(actualHandler, m2t, h, custom);

Error in matlab2tikz>handleAllChildren (line 691)
                [m2t, str] = handleObject(m2t, child, @drawHggroup);

Error in matlab2tikz>drawAxes (line 880)
    [m2t, childrenEnvs] = handleAllChildren(m2t, handle);

Error in matlab2tikz>saveToFile (line 482)
        m2t = drawAxes(m2t, relevantAxesHandle);

Error in matlab2tikz (line 334)
    m2t = saveToFile(m2t, fid, fileWasOpen);

To recreate use, e.g., bodeplot(tf('s')). I need bodeplot to use specific plot options.

@ThexXTURBOXx
Copy link

ThexXTURBOXx commented Oct 9, 2023

bodeplot(tf('s'))
matlab2tikz('dd.tex')

Yields no error and a rather correct output file (compiled using pdflatex -synctex=1 -interaction=nonstopmode "\documentclass{article}\usepackage{tikz}\usepackage{pgfplots}\pgfplotsset{compat=1.18}\begin{document}\resizebox{\textwidth}{!}{\input{%*}}\end{document}"):
grafik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants