No appropriate method 'TOCObj' for class 'mlreportgen.report.TableOfContents'.
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Sai Sri Pathuri
2019-8-8
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 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!