diff options
| author | Joel Martin <github@martintribe.org> | 2015-02-08 13:18:08 -0600 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2015-02-08 23:51:22 -0600 |
| commit | 6d12affa8bc91a6662e8d4bdcc66a6963b77e947 (patch) | |
| tree | 644d5a482081600faafc09e679fb1006796de659 /matlab/printer.m | |
| parent | d6624158bdf41e047ad8d0a9942238dc80649901 (diff) | |
| download | mal-6d12affa8bc91a6662e8d4bdcc66a6963b77e947.tar.gz mal-6d12affa8bc91a6662e8d4bdcc66a6963b77e947.zip | |
matlab: all step4 except optional.
Diffstat (limited to 'matlab/printer.m')
| -rw-r--r-- | matlab/printer.m | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/matlab/printer.m b/matlab/printer.m index 9308a96..11e22a8 100644 --- a/matlab/printer.m +++ b/matlab/printer.m @@ -8,7 +8,14 @@ classdef printer case 'double' str = num2str(obj); case 'char' - str = strcat('"', obj, '"'); + if print_readably + str = strrep(obj, '\', '\\'); + str = strrep(str, '"', '\"'); + str = strrep(str, char(10), '\n'); + str = strcat('"', str, '"'); + else + str = obj; + end case 'cell' strs = cellfun(@(x) printer.pr_str(x, print_readably), ... obj, 'UniformOutput', false); |
