We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bad2627 + 6458287 commit 814bf16Copy full SHA for 814bf16
plotly/plotly_aux/m2json.m
@@ -25,8 +25,14 @@
25
valstr = strrep(valstr, 'Inf', 'null');
26
valstr = strrep(valstr, 'NaN', 'null');
27
elseif ischar(val)
28
- val = checkescape(val); %add escape characters
29
- valstr = ['"' val '"'];
+ [r, ~] = size(val);
+ % We can't use checkescape() if we have ['abc'; 'xyz']
30
+ if r > 1
31
+ valstr = cell2json(cellstr(val));
32
+ else
33
+ val = checkescape(val); %add escape characters
34
+ valstr = ['"' val '"'];
35
+ end
36
elseif islogical(val)
37
if val
38
valstr = 'true';
0 commit comments