www.gusucode.com > rptgen 案例源码程序 matlab代码 > rptgen/magic_oo.m
%% Object-Oriented Report % This example illustrates an object-oriented approach for creating reports % with template-based (DOM) report objects. With this approach, you derive % a report class from mlreportgen.dom.Document or DocumentPart class that % defines methods for filling holes in a report's template and inherits a % fill method from its parent. You can then create a report by creating an % instance of this class and calling the instance's inherited fill method. % % Copyright 2014-2015 The MathWorks, Inc. %% The RPTMAGICOO Function % The RPTMAGICOO function exemplifies the object-oriented approach to generating % a report with DOM objects. This is what the RPTMAGICOO function looks like: type rptmagicoo %% The Master Report Class % The RPTMAGIC function uses a custom report class to create the report. % This is what this class looks like: dir = fullfile(matlabroot, 'toolbox', 'rptgen', 'rptgendemos', 'domapi'); type(fullfile(dir, '+mlreportgen/+examples/+magic/Report.m')); %% The Chapter Part Class % The fillMagicSquare method of the master report class % uses a custom document part class to create each chapter of the % report. This is what this class looks like: type(fullfile(dir, '+mlreportgen/+examples/+magic/MagicSquare.m'));