Skip to content

Commit 7465e77

Browse files
committed
Fix for change in behaviour of char()
1 parent 16bfce6 commit 7465e77

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

Quaternion.m

+6-2
Original file line numberDiff line numberDiff line change
@@ -687,9 +687,13 @@ function display(q)
687687
% See also UnitQuaternion.char.
688688

689689
if length(q) > 1
690-
s = '';
690+
s = [];
691691
for qq = q;
692-
s = char(s, char(qq));
692+
if isempty(s)
693+
s = char(qq);
694+
else
695+
s = char(s, char(qq));
696+
end
693697
end
694698
return
695699
end

UnitQuaternion.m

+7-3
Original file line numberDiff line numberDiff line change
@@ -698,9 +698,13 @@ function animate(Q, varargin)
698698
% See also Quaternion.char.
699699

700700
if length(q) > 1
701-
s = '';
702-
for qq = q(:)'
703-
s = char(s, char(qq));
701+
s = [];
702+
for qq = q;
703+
if isempty(s)
704+
s = char(qq);
705+
else
706+
s = char(s, char(qq));
707+
end
704708
end
705709
return
706710
end

0 commit comments

Comments
 (0)