From 95ee0857b9419a9bf7f173265b1d5db03b114724 Mon Sep 17 00:00:00 2001 From: Houtan Bastani Date: Fri, 29 Mar 2013 17:14:09 +0100 Subject: [PATCH] reporting: use end keyword in simplified syntax --- matlab/reports/@report/addGraph.m | 6 ++---- matlab/reports/@report/addSection.m | 3 +-- matlab/reports/@report/addTable.m | 6 ++---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/matlab/reports/@report/addGraph.m b/matlab/reports/@report/addGraph.m index a9b247b32..f5f48a7aa 100644 --- a/matlab/reports/@report/addGraph.m +++ b/matlab/reports/@report/addGraph.m @@ -29,8 +29,6 @@ function o = addGraph(o, varargin) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see . -lastPage = o.pages.numPages(); -lastSection = o.pages(lastPage).numSections(); -o.pages(lastPage).sections(lastSection) = ... - o.pages(lastPage).sections(lastSection).addGraph(varargin{:}); +o.pages(end).sections(end) = ... + o.pages(end).sections(end).addGraph(varargin{:}); end diff --git a/matlab/reports/@report/addSection.m b/matlab/reports/@report/addSection.m index a0667a5ec..47d2861f5 100644 --- a/matlab/reports/@report/addSection.m +++ b/matlab/reports/@report/addSection.m @@ -29,6 +29,5 @@ function o = addSection(o, varargin) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see . -o.pages(o.pages.numPages()) = ... - o.pages(o.pages.numPages()).addSection(varargin{:}); +o.pages(end) = o.pages(end).addSection(varargin{:}); end diff --git a/matlab/reports/@report/addTable.m b/matlab/reports/@report/addTable.m index 15199b4bd..3de9ddb39 100644 --- a/matlab/reports/@report/addTable.m +++ b/matlab/reports/@report/addTable.m @@ -29,8 +29,6 @@ function o = addTable(o, varargin) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see . -lastPage = o.pages.numPages(); -lastSection = o.pages(lastPage).numSections(); -o.pages(lastPage).sections(lastSection) = ... - o.pages(lastPage).sections(lastSection).addTable(varargin{:}); +o.pages(end).sections(end) = ... + o.pages(end).sections(end).addTable(varargin{:}); end