Skip to content

Commit 29263e6

Browse files
committed
helper functions for plotly offline
1 parent 4d9df0a commit 29263e6

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

plotly/plotly_aux/escapechars.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function clean = escapechars(dirty)
2+
% escape \ and % chars for sprintf
3+
clean = strrep(dirty,'\', '\\');
4+
clean = strrep(clean,'%', '%%');
5+
end

plotly/plotly_aux/validatedir.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
function validatedir(status, mess, messid, filename)
2+
% check success of directory creation
3+
if (status == 0)
4+
if(~strcmp(messid, 'MATLAB:MKDIR:DirectoryExists'))
5+
error(['Error saving %s folder: ' mess ', ' messid ...
6+
'. Please contact support@plot.ly for assistance.'], ...
7+
filename);
8+
end
9+
end
10+
end

0 commit comments

Comments
 (0)