diff --git a/matlab/reports/@graph/graph.m b/matlab/reports/@graph/graph.m index 16a6c74c82959c96dc809b530515e6e22b729a0b..4a0eaca538b0423537c9f4bef0e8cac4ea980590 100644 --- a/matlab/reports/@graph/graph.m +++ b/matlab/reports/@graph/graph.m @@ -73,13 +73,15 @@ elseif nargin > 1 'pairs.']); end - optNames = lower(fieldnames(o)); + optNames = fieldnames(o); % overwrite default values for pair = reshape(varargin, 2, []) field = lower(pair{1}); - if any(strmatch(field, optNames, 'exact')) - o.(field) = pair{2}; + ind = strmatch(field, lower(optNames), 'exact'); + assert(isempty(ind) || length(ind) == 1); + if ~isempty(ind) + o.(optNames{ind}) = pair{2}; else error('@graph.graph: %s is not a recognized option.', field); end diff --git a/matlab/reports/@page/page.m b/matlab/reports/@page/page.m index a0469e0ccc4922fb9768534819a331cc00b845bd..5702dd4de221f674634dfea92a7bd0200c725db8 100644 --- a/matlab/reports/@page/page.m +++ b/matlab/reports/@page/page.m @@ -48,13 +48,15 @@ elseif nargin > 1 'pairs.']); end - optNames = lower(fieldnames(o)); + optNames = fieldnames(o); % overwrite default values for pair = reshape(varargin, 2, []) field = lower(pair{1}); - if any(strmatch(field, optNames, 'exact')) - o.(field) = pair{2}; + ind = strmatch(field, lower(optNames), 'exact'); + assert(isempty(ind) || length(ind) == 1); + if ~isempty(ind) + o.(optNames{ind}) = pair{2}; else error('@page.page: %s is not a recognized option.', field); end diff --git a/matlab/reports/@report/report.m b/matlab/reports/@report/report.m index 9497ce9988a3c331a9883a61b6272baa1c3707fa..f4c4b70936711d972ef2ba2c00d0666e7ba2fdac 100644 --- a/matlab/reports/@report/report.m +++ b/matlab/reports/@report/report.m @@ -54,13 +54,15 @@ elseif nargin > 1 'pairs']); end - optNames = lower(fieldnames(o)); + optNames = fieldnames(o); % overwrite default values for pair = reshape(varargin, 2, []) field = lower(pair{1}); - if any(strmatch(field, optNames, 'exact')) - o.(field) = pair{2}; + ind = strmatch(field, lower(optNames), 'exact'); + assert(isempty(ind) || length(ind) == 1); + if ~isempty(ind) + o.(optNames{ind}) = pair{2}; else error('@report.report: %s is not a recognized option.', ... field); diff --git a/matlab/reports/@section/section.m b/matlab/reports/@section/section.m index ba2bc2662456ecb35a43f2460f378b8bd04e1f32..aca48b8c189db1f79ddaa065a14eb65bad8b00ba 100644 --- a/matlab/reports/@section/section.m +++ b/matlab/reports/@section/section.m @@ -36,13 +36,15 @@ elseif nargin > 1 'pairs.']); end - optNames = lower(fieldnames(o)); + optNames = fieldnames(o); % overwrite default values for pair = reshape(varargin, 2, []) field = lower(pair{1}); - if any(strmatch(field, optNames, 'exact')) - o.(field) = pair{2}; + ind = strmatch(field, lower(optNames), 'exact'); + assert(isempty(ind) || length(ind) == 1); + if ~isempty(ind) + o.(optNames{ind}) = pair{2}; else error('@section.section: %s is not a recognized option.', ... field); diff --git a/matlab/reports/@series/series.m b/matlab/reports/@series/series.m index 95f48562b22d68b374821a843eff840e86d5fc5e..fe5759a1b998944c42d437b56fe8d5ee0b72ecb0 100644 --- a/matlab/reports/@series/series.m +++ b/matlab/reports/@series/series.m @@ -61,13 +61,15 @@ elseif nargin > 1 'pairs.']); end - optNames = lower(fieldnames(o)); + optNames = fieldnames(o); % overwrite default values for pair = reshape(varargin, 2, []) field = lower(pair{1}); - if any(strmatch(field, optNames, 'exact')) - o.(field) = pair{2}; + ind = strmatch(field, lower(optNames), 'exact'); + assert(isempty(ind) || length(ind) == 1); + if ~isempty(ind) + o.(optNames{ind}) = pair{2}; else error('@series.series: %s is not a recognized option.', field); end diff --git a/matlab/reports/@table/table.m b/matlab/reports/@table/table.m index 06928859894b5890df9c51e813cd01fc0c3e9e4a..0e8484238bc2b178ea7d323e50dcccca8a2e5f4f 100644 --- a/matlab/reports/@table/table.m +++ b/matlab/reports/@table/table.m @@ -58,13 +58,15 @@ elseif nargin > 1 'pairs.']); end - optNames = lower(fieldnames(o)); + optNames = fieldnames(o); % overwrite default values for pair = reshape(varargin, 2, []) field = lower(pair{1}); - if any(strmatch(field, optNames, 'exact')) - o.(field) = pair{2}; + ind = strmatch(field, lower(optNames), 'exact'); + assert(isempty(ind) || length(ind) == 1); + if ~isempty(ind) + o.(optNames{ind}) = pair{2}; else error('%s is not a recognized option to the Table constructor.', ... field); diff --git a/matlab/reports/@vspace/vspace.m b/matlab/reports/@vspace/vspace.m index 4958c48be1e5c172c38b2cd323a8802286ee4cb4..0af84127e1a3ed6adcdbb1edbd129a0d67c248c0 100644 --- a/matlab/reports/@vspace/vspace.m +++ b/matlab/reports/@vspace/vspace.m @@ -44,13 +44,15 @@ elseif nargin > 1 'pairs.']); end - optNames = lower(fieldnames(o)); + optNames = fieldnames(o); % overwrite default values for pair = reshape(varargin, 2, []) field = lower(pair{1}); - if any(strmatch(field, optNames, 'exact')) - o.(field) = pair{2}; + ind = strmatch(field, lower(optNames), 'exact'); + assert(isempty(ind) || length(ind) == 1); + if ~isempty(ind) + o.(optNames{ind}) = pair{2}; else error('@vspace.vspace: %s is not a recognized option.', field); end