No appropriate method 'TOCObj' for class 'mlreportg​en.report.​TableOfCon​tents'.

2 次查看(过去 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!

采纳的回答

Sai Sri Pathuri
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 个)

类别

Help CenterFile Exchange 中查找有关 Tables 的更多信息

产品


版本

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by