Skip to content

Commit cdb218d

Browse files
committed
use iso2mesh original function isoctavemesh in place of isoctave
1 parent 1409985 commit cdb218d

File tree

6 files changed

+26
-11
lines changed

6 files changed

+26
-11
lines changed

isoctave.m

Lines changed: 0 additions & 4 deletions
This file was deleted.

isoctavemesh.m

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
function [isoctave verinfo]=isoctavemesh
2+
%
3+
% [isoctave verinfo]=isoctavemesh
4+
%
5+
% determine whether the code is running in octave
6+
%
7+
% author: Qianqian Fang, <q.fang at neu.edu>
8+
%
9+
% output:
10+
% isoctave: 1 if in octave, otherwise 0
11+
% verinfo: a string, showing the version of octave (OCTAVE_VERSION)
12+
%
13+
% -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net)
14+
%
15+
verinfo='';
16+
isoctave=(exist('OCTAVE_VERSION','builtin')~=0);
17+
if(nargout==2 && isoctave)
18+
verinfo=OCTAVE_VERSION;
19+
end

loadjson.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@
438438
% Invalid characters will be converted to underscores, and the prefix
439439
% "x0x[Hex code]_" will be added if the first character is not a letter.
440440
if(~isempty(regexp(str,'^[^A-Za-z]','once')))
441-
if(~isoctave && str(1)+0 > 255)
441+
if(~isoctavemesh && str(1)+0 > 255)
442442
str=regexprep(str,'^([^A-Za-z])','x0x${sprintf(''%X'',unicode2native($1))}_','once');
443443
else
444444
str=sprintf('x0x%X_%s',char(str(1))+0,str(2:end));
@@ -447,7 +447,7 @@
447447
if(isvarname(str))
448448
return;
449449
end
450-
if(~isoctave)
450+
if(~isoctavemesh)
451451
str=regexprep(str,'([^0-9A-Za-z_])','_0x${sprintf(''%X'',unicode2native($1))}_');
452452
else
453453
cpos=regexp(str,'[^0-9A-Za-z_]');

loadubjson.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@
365365
% Invalid characters will be converted to underscores, and the prefix
366366
% "x0x[Hex code]_" will be added if the first character is not a letter.
367367
if(~isempty(regexp(str,'^[^A-Za-z]','once')))
368-
if(~isoctave && str(1)+0 > 255)
368+
if(~isoctavemesh && str(1)+0 > 255)
369369
str=regexprep(str,'^([^A-Za-z])','x0x${sprintf(''%X'',unicode2native($1))}_','once');
370370
else
371371
str=sprintf('x0x%X_%s',char(str(1)),str(2:end));
@@ -374,7 +374,7 @@
374374
if(isvarname(str))
375375
return;
376376
end
377-
if(~isoctave)
377+
if(~isoctavemesh)
378378
str=regexprep(str,'([^0-9A-Za-z_])','_0x${sprintf(''%X'',unicode2native($1))}_');
379379
else
380380
cpos=regexp(str,'[^0-9A-Za-z_]');

savejson.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
else
126126
opt=varargin2struct(varargin{:});
127127
end
128-
opt.IsOctave=isoctave;
128+
opt.IsOctave=isoctavemesh;
129129

130130
dozip=jsonopt('Compression','',opt);
131131
if(~isempty(dozip))
@@ -730,7 +730,7 @@
730730
%%-------------------------------------------------------------------------
731731
function newstr=escapejsonstring(str)
732732
newstr=str;
733-
isoct=isoctave;
733+
isoct=isoctavemesh;
734734
if(isoct)
735735
vv=sscanf(OCTAVE_VERSION,'%f');
736736
if(vv(1)>=3.8)

saveubjson.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
else
126126
opt=varargin2struct(varargin{:});
127127
end
128-
opt.IsOctave=isoctave;
128+
opt.IsOctave=isoctavemesh;
129129

130130
dozip=jsonopt('Compression','',opt);
131131
if(~isempty(dozip))

0 commit comments

Comments
 (0)