-
Notifications
You must be signed in to change notification settings - Fork 73
/
iso2meshver.m
41 lines (38 loc) · 1.15 KB
/
iso2meshver.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function [major, minor, patchnum, extra] = iso2meshver
%
% [major,minor,patchnum,extra]=iso2meshver
% or
% v=iso2meshver
%
% get the version number of iso2mesh toolbox
%
% author: Qianqian Fang, <q.fang at neu.edu>
%
% output:
% if you ask for a single output:
% v: a string denotes the current version number; the string is
% typically in the following format: "major.minor.patch-extra"
% where major/minor/patch are typically integers, and extra can
% be an arbitrary string and is optional
% if you ask for 4 outputs:
% [major,minor,patchnum,extra] are each field of the version string
%
% -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net)
%
major = 1;
minor = 9;
patchnum = 8;
extra = '$Rev:: $';
extra = regexprep(extra, '[\s$:]', '');
iso2meshvstr = sprintf('%d.%d.%d', major, minor, patchnum);
if (~isempty(extra))
iso2meshvstr = [iso2meshvstr '-' extra];
end
if (nargout == 0)
fprintf(1, 'iso2mesh toolbox version: %s\n', iso2meshvstr);
clear major;
elseif (nargout == 1)
major = iso2meshvstr;
elseif (nargout ~= 4)
error('you need to return either 1 or 4 output variables');
end