Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dóra Kocsis
dynare
Commits
f03bf0a6
Commit
f03bf0a6
authored
May 13, 2013
by
Houtan Bastani
Browse files
reporting: preserve case when assigning method options while allowing user to enter any case
parent
333d515f
Changes
7
Show whitespace changes
Inline
Side-by-side
matlab/reports/@graph/graph.m
View file @
f03bf0a6
...
...
@@ -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
...
...
matlab/reports/@page/page.m
View file @
f03bf0a6
...
...
@@ -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
...
...
matlab/reports/@report/report.m
View file @
f03bf0a6
...
...
@@ -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
);
...
...
matlab/reports/@section/section.m
View file @
f03bf0a6
...
...
@@ -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
);
...
...
matlab/reports/@series/series.m
View file @
f03bf0a6
...
...
@@ -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
...
...
matlab/reports/@table/table.m
View file @
f03bf0a6
...
...
@@ -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
);
...
...
matlab/reports/@vspace/vspace.m
View file @
f03bf0a6
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment