No appropriate method 'TOCObj' for class 'mlreportgen.report.TableOfContents'.
1 view (last 30 days)
Show older comments
Jack Arnoldi
on 5 Aug 2019
Answered: Sai Sri Pathuri
on 8 Aug 2019
Hello, I am trying to customize my table of contents in my report as presented the mlreportgen.report.TableOfContents class documentation. However I get an error when I do this
toc = TableOfContents;
toc.TOCObj.NumberOfLevels = 2;
add(rpt, toc);
The error is:
No appropriate method, property, or field 'TOCObj' for class 'mlreportgen.report.TableOfContents'.
Error in Mreport (line 92)
toc.TOCObj.NumberOfLevels = 2;
Has the TOCObj been removed from Matlab or does the error come from somewhere else?
Thank you in advance!
0 Comments
Accepted Answer
Sai Sri Pathuri
on 8 Aug 2019
I think you are using MATLAB R2018a version. But the example you are referring is from documentation of R2019a version (which supports the feature of specifying number of levels). The feature to programmatically specify the number of TOC levels is added in R2018b version.
Since you are using MATLAB R2018a, the error is being created (TOCObj is not supported in versions prior to R2018b). Try using MATLAB R2018b or R2019a.
You may refer Enhanced table of contents customization in the following link
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!