From 1d947711f53bf9be2aa876d532e9a1e7ab835142 Mon Sep 17 00:00:00 2001 From: Ferdinand Fischer <ferdinand.fischer@fau.de> Date: Mon, 24 Feb 2020 10:33:50 +0100 Subject: [PATCH] Fixed call of quantity.Discrete.on( myGrid, myGridName ) --- +quantity/Discrete.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/+quantity/Discrete.m b/+quantity/Discrete.m index a914a0c..c3e0cab 100644 --- a/+quantity/Discrete.m +++ b/+quantity/Discrete.m @@ -268,7 +268,13 @@ classdef (InferiorClasses = {?quantity.Symbolic}) Discrete < handle & matlab.mi end end elseif nargin == 3 - assert(iscell(myDomain), 'If the domain is specified by cell-array pairs, the value myDomain must be a cell-array with grid entries') + % case 2: a domain is specified by a grid and a grid + % name. Then, the first input parameter is the grid, + % i.e., myGrid = myDomain and the second is the grid + % name. + myDomain = misc.ensureIsCell(myDomain); + gridNames = misc.ensureIsCell(gridNames); + assert(all(cellfun(@(v)isvector(v), myDomain)), 'The cell entries for a new grid have to be vectors') assert(iscell(gridNames), 'The gridNames parameter must be cell array') assert(all(cellfun(@ischar, gridNames)), 'The gridNames must be strings') -- GitLab