Don-Chris / Plot2LaTeX

Fork of Plot2LaTex.m by Jan de Jong
GNU Affero General Public License v3.0
4 stars 1 forks source link

"Index exceeds the number of array elements" Error with Version 2.3 #6

Closed Stefanski89 closed 9 months ago

Stefanski89 commented 9 months ago

Hello! I tried the new version of the function, but now I'm getting this error, and I have no idea where it's coming from. I have created a minimal example with a small plot, a .mat file with the data, the .fig file with the plot and an .m file to run everything. Do you have any advice on what I am doing wrong?

debug.zip

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

Error in Plot2LaTeX>to_cell (line 1166)
if iscell(input) && iscell(input{1})

Error in Plot2LaTeX>@(obj)to_cell(obj.TickLabels,true) (line 565)
    list(8) = struct('type','ZAxis','TrueText',@(obj) to_cell(obj.TickLabels,true),...

Error in Plot2LaTeX>addElement (line 583)
            data(:,idx) = [names(idx);to_cell(listElement.(names{idx})(elem))];

Error in Plot2LaTeX (line 402)
    Labels = addElement(AxeObj(i).ZAxis,'ZAxis', Labels);
Don-Chris commented 9 months ago

Thank you for uploading this test script. The bug is fixed in version 2.3.1