From c2262979be803e741c44d28dc79444c7a08d90ce Mon Sep 17 00:00:00 2001 From: ac_sb33 <acohen@coe.drexel.edu> Date: Fri, 16 Aug 2019 09:19:41 -0400 Subject: [PATCH] new string format in press.m 'v1' ; 'v2' --- Press.m | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Press.m b/Press.m index 40e6acd..e54c3f3 100644 --- a/Press.m +++ b/Press.m @@ -59,6 +59,8 @@ function nBytes = Press(V1,V2) persistent lib if ~libisloaded('lib') + warning('off','MATLAB:loadlibrary:StructTypeExists'); + warning('off','MATLAB:loadlibrary:parsewarnings'); loadlibrary bz2dll.dll bzlib.h alias lib end @@ -69,7 +71,8 @@ end if iscell(V2) V2=cell2mat(V2); end -vv= mat2str([V1;V2]); + +vv=combineString(V1,V2); sz=length(vv(:)); dsz=sz+1024; @@ -85,6 +88,20 @@ if rval end nBytes=double(get(pdsz, 'Value')); -end +function vv=combineString(V1,V2) + +s1=prepareString(V1); +s2=prepareString(V2); +vv=[s1 ';' s2]; + +function s=prepareString(v) +if isempty(v) + s=''; + return +end +s=mat2str(v); +if length(v)>1 + s=s(2:end-1); +end -- GitLab