From 18b4a85644b11f2fc34a4b50cedd6580a685f8ae Mon Sep 17 00:00:00 2001 From: Houtan Bastani <houtan@dynare.org> Date: Mon, 4 Feb 2019 17:56:45 +0100 Subject: [PATCH] subsample: check for correct number of arguments to function --- src/@dseries/subsample.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/@dseries/subsample.m b/src/@dseries/subsample.m index 270fb47..2886b09 100644 --- a/src/@dseries/subsample.m +++ b/src/@dseries/subsample.m @@ -41,6 +41,10 @@ function p = subsample(o, d1, d2) % --*-- Unitary tests --*-- % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. +if nargin < 1 || nargin > 3 + error('function takes 1 to 3 arguments') +end + if nargin == 1 p = copy(o); return -- GitLab