Skip to content

Commit

Permalink
fix bugs in string support
Browse files Browse the repository at this point in the history
  • Loading branch information
petercorke committed Feb 10, 2021
1 parent dfe71e3 commit d6f038a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tb_optparse.m
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@
assert(iscell(argv), 'SMTB:tboptparse:badargs', 'input must be a cell array');

if ~verLessThan('matlab', '9.1')
% strings only appeared in 2016b
% is only appeared in 2016b

% handle new style string inputs
% quick and dirty solution is to convert any string to a char array and
% then carry on as before

% convert any passed strings to character arrays
for i=1:length(argv)
if isstring(argv{i})
if isstring(argv{i}) && length(argv{i}) == 1
argv{i} = char(argv{i});
end
end
Expand Down

0 comments on commit d6f038a

Please sign in to comment.