Index: /prdatasets/arrhythmia.m
===================================================================
--- /prdatasets/arrhythmia.m	(revision 136)
+++ /prdatasets/arrhythmia.m	(revision 137)
@@ -1,56 +1,55 @@
-%ARRHYTHMIA 420 objects with 279 features in 12 classes
+%ARRHYTHMIA 452 objects with 279 features in 13 classes
 %
-%        X = ARRHYTHMIA(CLASS,VAL)
+%        X = ARRHYTHMIA(VAL)
 %
 % The aim is to distinguish between the presence and absence of cardiac
-% arrhythmia and to classify it in one of the 16 groups. Class 01 refers
-% to 'normal' ECG classes 02 to 15 refers to different classes of
-% arrhythmia and class 16 refers to the rest of unclassified ones. 
-%
-%       X = ARRHYTHMIA(VAL);
+% arrhythmia and to classify it in one of the 13 groups. Class 1 refers
+% to 'normal' ECG classes 2 to 13 refer to different classes of
+% arrhythmia. 
 %
 % By default features with missing values are removed. When something else
 % is desired, use one of the options in MISVAL for VAL.
 %
-% SEE ALSO <a href="http://prtools.tudelft.nl/prtools">PRTools Guide</a>, <a href="http://archive.ics.uci.edu/ml/">UCI Website</a>
+% SEE ALSO <a href="http://37steps.com/prtools">PRTools Guide</a>, <a href="http://archive.ics.uci.edu/ml/">UCI Website</a>
 % PRTOOLS, DATASETS, MISVAL
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 
-function x = arrhythmia(val)
-if nargin < 1, 	val = 'f-remove'; end
-a = pr_getdata('http://prtools.tudelft.nl/prdatasets/arrhythmia.dat',1);
+function a = arrhythmia(val)
 
-
-user.desc=['The Arrhymthmia database from UCI. The aim is to ' ...
+if nargin < 1,   val = 'f-remove'; end
+a = pr_loadmatfile;
+if isempty(a)
+  opt.delimeter = ',';
+  opt.labfeat   = 280;
+  fl = {'age' 'sex' 'height' 'weight' 'QRS duration' 'P-R interval' ...
+    'Q-T interval' 'T interval' 'P interval' 'QRS' 'T' 'P' 'QRST' ...
+    'J' 'heartrate'};
+  fl1 = {'Q wave width' 'R wave width' 'S wave width' 'R'' wave width' ...
+    'S'' wave width' 'number of intrinsic deflections' ...
+    'ragged R wave' 'diphasic derivation of R wave' ...
+    'ragged P wave' 'diphasic derivation of P wave' ...
+    'ragged T wave' 'diphasic derivation of T wave'};
+  fl = [fl strcat('DI-',fl1) strcat('DII-',fl1) strcat('DIII-',fl1) ...
+    strcat('AVR-',fl1) strcat('AVL-',fl1) strcat('AVF-',fl1) ...
+    strcat('V1-',fl1) strcat('V2-',fl1) strcat('V3-',fl1) ...
+    strcat('V4-',fl1) strcat('V5-',fl1) strcat('V6-',fl1)];
+  fl2 = {'JJ wave ampl' 'Q wave ampl' 'R wave ampl' ...
+    'S wave ampl' 'R'' wave ampl' 'S'' wave ampl' 'P wave ampl' ...
+    'T wave ampl' 'QRSA sum' 'QRSTA'};
+  fl = [fl strcat('DI-',fl2) strcat('DII-',fl2) strcat('DIII-',fl2) ...
+    strcat('AVR-',fl2) strcat('AVL-',fl2) strcat('AVF-',fl2) ...
+    strcat('V1-',fl2) strcat('V2-',fl2) strcat('V3-',fl2) ...
+    strcat('V4-',fl2) strcat('V5-',fl2) strcat('V6-',fl2)];
+  opt.featnames = fl;
+  opt.dsetname = 'Arrhythmia normal';
+%   opt.classnames = {'benign' 'malignant'};
+  opt.desc=['The Arrhymthmia database from UCI. The aim is to ' ...
            'distinguish between the presence and absence of cardiac ' ...
            'arrhythmia and to classify it in one of the 16 groups.'];
-user.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/arrhythmia';
-
-fl = {'age' 'sex' 'height' 'weight' 'QRS duration' 'P-R interval' ...
-'Q-T interval' 'T interval' 'P interval' 'QRS' 'T' 'P' 'QRST' ...
-'J' 'heartrate'};
-fl1 = {'Q wave width' 'R wave width' 'S wave width' 'R'' wave width' ...
-'S'' wave width' 'number of intrinsic deflections' ...
-'ragged R wave' 'diphasic derivation of R wave' ...
-'ragged P wave' 'diphasic derivation of P wave' ...
-'ragged T wave' 'diphasic derivation of T wave'};
-fl = [fl strcat('DI-',fl1) strcat('DII-',fl1) strcat('DIII-',fl1) ...
-strcat('AVR-',fl1) strcat('AVL-',fl1) strcat('AVF-',fl1) ...
-strcat('V1-',fl1) strcat('V2-',fl1) strcat('V3-',fl1) ...
-strcat('V4-',fl1) strcat('V5-',fl1) strcat('V6-',fl1)];
-fl2 = {'JJ wave ampl' 'Q wave ampl' 'R wave ampl' ...
-'S wave ampl' 'R'' wave ampl' 'S'' wave ampl' 'P wave ampl' ...
-'T wave ampl' 'QRSA sum' 'QRSTA'};
-fl = [fl strcat('DI-',fl2) strcat('DII-',fl2) strcat('DIII-',fl2) ...
-strcat('AVR-',fl2) strcat('AVL-',fl2) strcat('AVF-',fl2) ...
-strcat('V1-',fl2) strcat('V2-',fl2) strcat('V3-',fl2) ...
-strcat('V4-',fl2) strcat('V5-',fl2) strcat('V6-',fl2)];
-
-x = pr_dataset(a(:,1:(end-1)),a(:,end));
-x = setfeatlab(x,fl);
-x = setname(x,'Arrhythmia normal');
-x = setuser(x,user);
-x = misval(x,val);
+  opt.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/arrhythmia';  
+  a = pr_download('http://prtools.tudelft.nl/prdatasets/arrhythmia.dat',[],opt);
+end
+a = misval(a,val);
 
 return
Index: /prdatasets/auto_mpg.m
===================================================================
--- /prdatasets/auto_mpg.m	(revision 136)
+++ /prdatasets/auto_mpg.m	(revision 137)
@@ -7,9 +7,9 @@
 %
 % There are two classes: 229 objects < 25 mpg and 169 objects > 25 mpg.
-% For some reasons one of the original features is missing (horsepower).
+% For some reason one of the original features is missing (horsepower).
 %
 % See also DATASETS, PRDATASETS
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -18,6 +18,6 @@
 
 function a = auto_mpg
-a = pr_getdata('http://prtools.tudelft.nl/prdatasets/auto_mpg.mat',1);
-%a = setname(a,'Car-miles-per-gallon');
+
+a = pr_getdata;
 a = setlablist(a,char('< 25 mpg ','> 25 mpg'));
 a = setfeatlab(a,char(...
@@ -28,2 +28,3 @@
         'model year: multi-valued discrete', ...
         'origin: multi-valued discrete'));
+a = setname(a,'Auto MPG');
Index: /prdatasets/biomed.m
===================================================================
--- /prdatasets/biomed.m	(revision 136)
+++ /prdatasets/biomed.m	(revision 137)
@@ -15,24 +15,24 @@
 % Just the original features 3, 5, 6, 7 and 8 are used.
 %
-% SEE ALSO <a href="http://prtools.tudelft.nl/prtools">PRTools Guide</a>, <a href="http://archive.ics.uci.edu/ml/">UCI Website</a>
+% SEE ALSO <a href="http://37steps.com/prtools">PRTools Guide</a>, <a href="http://archive.ics.uci.edu/ml/">UCI Website</a>
 % PRTOOLS, DATASETS, MISVAL
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 
-function x = biomed(val)
+function a = biomed(val)
 
 if nargin < 1, val = 'remove'; end
-a = pr_getdata('http://prtools.tudelft.nl/prdatasets/biomed.dat',1);
 
-user.desc = 'The purpose of the analysis is to develop a screening procedure to detect carriers and to describe its effectiveness. ';
-user.link = 'http://lib.stat.cmu.edu/datasets/';
-cl = {'carrier' 'normal'};
-fl = {'age' 'measurement 1' 'measurement 2' 'measurement 3' 'measurement 4'};
-
-x = pr_dataset(a(:,[3 5 6 7 8]),cl(a(:,end)));
-x = setfeatlab(x,fl);
-x = setname(x,'Biomed');
-x = setuser(x,user);
-x = misval(x,val);
+a = pr_loadmatfile;
+if isempty(a)
+  opt.labfeat   = 9;
+  opt.feats     = [3,5,6,7,8];
+  opt.featnames = {'age' 'measurement 1' 'measurement 2' 'measurement 3' 'measurement 4'};
+  opt.classnames = {'carrier' 'normal'};
+  opt.desc = 'The purpose of the analysis is to develop a screening procedure to detect carriers and to describe its effectiveness. ';
+  opt.link = 'http://lib.stat.cmu.edu/datasets/';
+  a = pr_download('http://prtools.tudelft.nl/prdatasets/biomed.dat',[],opt);
+end
+a = misval(a,val);
 
 return
Index: /prdatasets/breast.m
===================================================================
--- /prdatasets/breast.m	(revision 136)
+++ /prdatasets/breast.m	(revision 137)
@@ -13,36 +13,32 @@
 %
 % By default objects with missing values are removed. When something else
-% is desired, use one of the options in MISVAL for Val.
+% is desired, use one of the options in MISVAL for VAL.
 %
-% SEE ALSO <a href="http://prtools.tudelft.nl/prtools">PRTools Guide</a>, <a href="http://archive.ics.uci.edu/ml/">UCI Website</a>
+% SEE ALSO <a href="http://37steps.com/prtools">PRTools Guide</a>, <a href="http://archive.ics.uci.edu/ml/">UCI Website</a>
 % PRTOOLS, DATASETS, MISVAL
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 
-function x = breast(val)
+function a = breast(val)
 
 if nargin < 1, val = 'remove'; end
-%prdatasets(mfilename,1,'http://prtools.tudelft.nl/prdatasets/breastorg.dat');
 
-a = pr_getdata('http://prtools.tudelft.nl/prdatasets/breastorg.dat',1);
-
-user.desc='The original database of the Wisconsin Breast Cancer Databases from UCI, containing 699 instances, collected between 1989 and 1991. ';
-user.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/breast-cancer-wisconsin/';
-cl = {'benign' 'malignant'};
-fl = {'Clump Thickness' 'Uniformity of Cell Size' ...
-'Uniformity of Cell Shape' 'Marginal Adhesion' ...
-'Single Epithelial Cell Size' 'Bare Nuclei' 'Bland Chromatin' ...
-'Normal Nucleoli' 'Mitoses'};
-
-%a = load('breastorg.dat'); % Octave cannot find it
-%a = load(fullfile(fileparts(which(mfilename)),'breastorg.dat'));
-J = find(a==-1);
-a(J) = NaN;
-nlab = a(:,end)/2;   % the labels for the classes are (2,4), very strange
-x = pr_dataset(a(:,2:(end-1)), cl(nlab) );
-x = setfeatlab(x,fl);
-x = setname(x,'Breast Wisconsin');
-x = misval(x,val);
-x = setuser(x,user);
+a = pr_loadmatfile;
+if isempty(a)
+  opt.delimeter = ',';
+  opt.labfeat   = 11;
+  opt.featnames = {'Clump Thickness' 'Uniformity of Cell Size' ...
+    'Uniformity of Cell Shape' 'Marginal Adhesion' ...
+    'Single Epithelial Cell Size' 'Bare Nuclei' 'Bland Chromatin' ...
+    'Normal Nucleoli' 'Mitoses'};
+  opt.feats = [2:10];
+  opt.misvalue = -1;
+  opt.classnames = {'benign' 'malignant'};
+  opt.desc='The original database of the Wisconsin Breast Cancer Databases from UCI, containing 699 instances, collected between 1989 and 1991. ';
+  opt.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/breast-cancer-wisconsin/';
+  opt.dsetname = 'Breast Wisconsin';
+  a = pr_download('http://prtools.tudelft.nl/prdatasets/breastorg.dat',[],opt);
+end
+a = misval(a,val);
 
 return
Index: /prdatasets/car.m
===================================================================
--- /prdatasets/car.m	(revision 136)
+++ /prdatasets/car.m	(revision 137)
@@ -8,19 +8,24 @@
 % 1(1), pp. 145-157, 1990.). All 6 features are nominal.
 % The instances completely cover the attribute space.
+%
+% SEE ALSO <a href="http://37steps.com/prtools">PRTools Guide</a>, <a href="http://archive.ics.uci.edu/ml/">UCI Website</a>
+% PRTOOLS, DATASETS
 
-function x = car
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 
-prdatasets(mfilename,1,'http://prtools.tudelft.nl/prdatasets/car.data');
-% for some mysterious reason it appeared to be necessary on my Windows 7
-% system to repeat this command
-prdatasets(mfilename,1,'http://prtools.tudelft.nl/prdatasets/car.data');
-user.desc = 'Car Evaluation Database was derived from a simple hierarchical decision model originally developed for the demonstration of DEX (M. Bohanec, V. Rajkovic: Expert system for decision making. Sistemica 1(1), pp. 145-157, 1990.).';
-fl = {'buying price' 'maintenance price' 'nr of doors' 'nr of persons' 'luggage boot' 'safety'};
- 
-datfile = fullfile(fileparts(which(mfilename)),'car.data');
-x = pr_readdataset(datfile,0,',',[],'ccccccc',7);
-x = setfeatlab(x,fl);
-x = setuser(x,user);
-x = setname(x,'Car');
+function a = car
+
+a = pr_loadmatfile;
+if isempty(a)
+  opt.delimeter = ',';
+  opt.format = 'ccccccc';
+  opt.labfeat = 7;
+  opt.desc = 'Car Evaluation Database was derived from a simple hierarchical decision model originally developed for the demonstration of DEX (M. Bohanec, V. Rajkovic: Expert system for decision making. Sistemica 1(1), pp. 145-157, 1990.).';
+  opt.featnames = {'buying price' 'maintenance price' 'nr of doors' 'nr of persons' 'luggage boot' 'safety'};
+  opt.desc = 'The purpose of the analysis is to develop a screening procedure to detect carriers and to describe its effectiveness. ';
+  opt.link = 'http://lib.stat.cmu.edu/datasets/';
+  opt.dsetname = 'Car';
+  a = pr_download('http://prtools.tudelft.nl/prdatasets/car.data',[],opt);
+end
 
 return
Index: /prdatasets/cbands.m
===================================================================
--- /prdatasets/cbands.m	(revision 136)
+++ /prdatasets/cbands.m	(revision 137)
@@ -9,5 +9,5 @@
 % See also DATASETS, PRDATASETS
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -15,5 +15,4 @@
 function a = cbands
 
-prdatasets(mfilename,1);
-a = pr_dataset('cbands');
+a = pr_getdata;
 a = setname(a,'Chromosome Bands');
Index: datasets/cell2dset.m
===================================================================
--- /prdatasets/cell2dset.m	(revision 136)
+++ 	(revision )
@@ -1,107 +1,0 @@
-%CELL2DSET Construct dataset from a cell array having one feature per cell.
-%
-%   A = CELL2DSET(C,F,M,L)
-%
-% INPUT
-%   C  Cell array with one cell per feature. Categorical features should
-%      be given by strings in a character array or as cellstrings (one
-%      object per cell) stored in the feature cell.
-%      Numerical features may either be stored as character arrays, cell
-%      strings or as a numeric vector.
-%      In case C is a 2D cell array columns are first combined into a
-%      cellstring or a vector.
-%   F  Format field (e.g. 'ccncnn') for distinguishing cell character
-%      arrays with categorical data ('c') from numeric data ('n').
-%   M  Optional character array with symbols used for missing values. The 
-%      empty string ('') will always be interpreted as a missing value.
-%   L  Labels that may be used for labelling A (numbers or strings, see
-%      PRDATASET). (optional)
-%
-% OUTPUT
-%   A  Dataset with categorical features numerically coded as indices in 
-%      the DATA field, pointing to the list on category names stored in the  
-%      FEATDOM field, see SETFEATDOM.
-%
-% DESCRIPTION
-% This routine is an alternative for PRDATASET in case data is given by
-% strings or numeric characters. The parameter F is optional. If not given
-% all character arrays and cell strings are interpreted as categorical.
-%
-% Missing data (empty strings), will be coded as a NaNs.
-%
-% SEE ALSO <a href="http://prtools.tudelft.nl/prtools">PRTools Guide</a>
-% DATASETS, SETFEATDOM, FEATTYPES, DSET2CELL, CAT2DSET, DSET2CELL
-
-% Copyright: R.P.W. Duin
-
-function a = cell2dset(c,varargin)
-
-[f,misval,lab] = setdefaults(varargin,'',[],[]);
-
-if ~iscell(c)
-  error('Cell array expected')
-end
-
-if min(size(c)) > 1       % 2D cell array, make 1D
-  cc = cell(1,size(c,2));
-  for j=1:size(c,2)
-    try
-      x = cell2mat(c(:,j));
-      cc{1,j} = x;
-      f = [f 'n'];
-    catch
-      try
-        x = char(c(:,j));
-        cc{1,j} = x;
-        f = [f 'c'];
-      catch
-        cc{1,j} = NaN(size(c,1),1);
-        f = [f 'n'];
-      end
-    end
-  end
-  c = cc;
-end
-
-m = size(c{1},1);         % number of objects
-k = numel(c);             % number of features
-a = zeros(m,k);           % numeric data will be stored here
-if ~isempty(f)            % decode format statement
-  if numel(f) ~= k
-    error('format string has wrong size')
-  end
-else
-  f = repmat('x',1,k);    % indicates: no format given
-end
-
-fdom = cell(1,numel(c));  % space for feature domains
-for j=1:numel(c)          % run over all features
-  if size(c{j},1) ~= m
-    error('Not the same number of objects for all features')
-  end
-  if ischar(c{j}) || iscell(c{j})
-    cc = cellstr(c{j});
-    if ~isempty(misval)
-      for i=1:numel(misval)
-        L = find(strcmp(misval(i),cc));
-        cc(L) = [repmat({''},numel(L),1)];
-      end
-    end
-    L = find(strcmp('',cc));    % find missing values
-    if (f(j) == 'x') || (f(j) == 'c')
-      % interpret as category data, use renumlab for coding
-      [a(:,j),fdom{j}] = renumlab(cc);
-      a(L,j) = NaN(numel(L),1);
-    elseif f(j) == 'n'
-      cc(L) = [repmat({'NaN'},numel(L),1)]; % put a 'NaN' for missing
-      a(:,j) = str2num(char(cc)); % convert
-    else
-      error('Wrong format found')
-    end
-  else
-    a(:,j) = c{j};
-  end
-end
-    
-a = prdataset(a,lab);
-a = setfeatdom(a,fdom);
Index: /prdatasets/chromo.m
===================================================================
--- /prdatasets/chromo.m	(revision 136)
+++ /prdatasets/chromo.m	(revision 137)
@@ -6,5 +6,5 @@
 % thresholded chromosomes. This technique is outdated.
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -12,6 +12,4 @@
 function a = chromo
 
-prdatasets(mfilename,1);
-datfile = fullfile(fileparts(which(mfilename)),'chromo');
-a = pr_dataset(datfile);
+a = pr_getdata;
 a = setname(a,'Chromosome Features');
Index: /prdatasets/diabetes.m
===================================================================
--- /prdatasets/diabetes.m	(revision 136)
+++ /prdatasets/diabetes.m	(revision 137)
@@ -8,19 +8,18 @@
 % //www.ics.uci.edu/~mlearn/MLRepository.html
 
-function x = diabetes
-
-prdatasets(mfilename,1,'http://prtools.tudelft.nl/prdatasets/diabetes.dat');
-user.desc='The Pima Indians Diabetes Database from UCI.';
-user.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/pima-indians-diabetes/';
-cl = {'present' 'absent'};
-fl = {'NumPregnancies' 'plasmaGlucose' 'diastolicBloodPr' ...
-'tricepsSkinfold' '2hrSerumInsulin' 'BodyMassIndex' ...
-'DiabetesPedigreeFn' 'Age'};
-
-a = load('diabetes.dat');
-x = pr_dataset(a(:,1:(end-1)),cl(a(:,end)+1));
-x = setfeatlab(x,fl);
-x = setname(x,'Diabetes');
-x = setuser(x,user);
+function a = diabetes
+ 
+a = pr_loadmatfile;
+if isempty(a)
+  opt.delimeter = ' ';
+  opt.labfeat   = 9;
+  opt.featnames = {'NumPregnancies' 'plasmaGlucose' 'diastolicBloodPr' ...
+        'tricepsSkinfold' '2hrSerumInsulin' 'BodyMassIndex' ...
+        'DiabetesPedigreeFn' 'Age'};
+  opt.classnames = {'present' 'absent'};
+  opt.link  = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/pima-indians-diabetes/';
+  opt.desc  = 'The Pima Indians Diabetes Database from UCI.';
+  a = pr_download('http://prtools.tudelft.nl/prdatasets/diabetes.dat',[],opt);
+end
 
 return
Index: /prdatasets/ecoli.m
===================================================================
--- /prdatasets/ecoli.m	(revision 136)
+++ /prdatasets/ecoli.m	(revision 137)
@@ -7,20 +7,20 @@
 % This is the 'Ecoli'  dataset of the UCI Machine Learning Repository, 
 % //www.ics.uci.edu/~mlearn/MLRepository.html
-function x = ecoli
 
-prdatasets(mfilename,1,'http://prtools.tudelft.nl/prdatasets/ecoli.dat');
-user.desc='The Ecoli database from UCI. Goal is to Predict the localization site of protein in a cell, by Kenta Nakai Institue of Molecular and Cellular Biology Osaka, University.';
-user.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/ecoli/';
-cl = {'cytoplasm' 'inner membrane without signal sequence' ...
-'periplasm' 'inner membrane, uncleavable signal sequence' ...
-'outer membrane' 'outer membrane lipoprotein' ...
-'inner membrane lipoprotein' 'inner membrane, cleavable signal sequence'};
-fl = {'mcg' 'gvh' 'lip' 'chg' 'aac' 'alm1' 'alm2'};
+function a = ecoli
 
-a = load('ecoli.dat');
-x = pr_dataset(a(:,1:(end-1)),cl(a(:,end)));
-x = setfeatlab(x,fl);
-x = setname(x,'Ecoli');
-x = setuser(x,user);
+a = pr_loadmatfile;
+if isempty(a)
+  opt.labfeat   = 8;
+  opt.featnames = {'mcg' 'gvh' 'lip' 'chg' 'aac' 'alm1' 'alm2'};
+  opt.classnames = {'cytoplasm' 'inner membrane without signal sequence' ...
+    'periplasm' 'inner membrane, uncleavable signal sequence' ...
+    'outer membrane' 'outer membrane lipoprotein' ...
+    'inner membrane lipoprotein' 'inner membrane, cleavable signal sequence'};
+  opt.desc='The Ecoli database from UCI. Goal is to Predict the localization site of protein in a cell, by Kenta Nakai Institue of Molecular and Cellular Biology Osaka, University.';
+  opt.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/ecoli/';
+  opt.dsetname = 'Ecoli';
+  a = pr_download('http://prtools.tudelft.nl/prdatasets/ecoli.dat',[],opt);
+end
 
 return
Index: /prdatasets/emim.m
===================================================================
--- /prdatasets/emim.m	(revision 136)
+++ /prdatasets/emim.m	(revision 137)
@@ -16,5 +16,5 @@
 % See also DATASETS, PRDATASETS
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5038, 2600 GA Delft, The Netherlands
@@ -28,7 +28,6 @@
 end
 
-name = ['emim' num2str(n)];
-prdatasets(mfilename,1,['http://prtools.tudelft.nl/prdatasets/' name '.mat']);
-a = pr_dataset(name);
+name = ['emim' num2str(n) '.mat'];
+a = pr_getdata(['http://prtools.tudelft.nl/prdatasets/' name],[],name);
 a = setname(a,['EM' num2str(n) ' Image Delft']);
 
Index: /prdatasets/glass.m
===================================================================
--- /prdatasets/glass.m	(revision 136)
+++ /prdatasets/glass.m	(revision 137)
@@ -16,5 +16,5 @@
 % See also DATASETS, PRDATASETS
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -22,6 +22,5 @@
 function a = glass
 
-prdatasets(mfilename,1);
-a = pr_dataset('glass');
+a = pr_getdata('http://prtools.tudelft.nl/prdatasets/glass.mat',1);
 a = setname(a,'Glass Identification Dataset');
 a = setlablist(a,char('BuildingFloat','BuildingNonFloat','Car','Other'));
Index: /prdatasets/heart.m
===================================================================
--- /prdatasets/heart.m	(revision 136)
+++ /prdatasets/heart.m	(revision 137)
@@ -11,33 +11,34 @@
 % is desired, use one of the options in MISVAL.
 %
-% SEE ALSO <a href="http://prtools.tudelft.nl/prtools">PRTools Guide</a>, <a href="http://archive.ics.uci.edu/ml/">UCI Website</a>
+% SEE ALSO <a href="http://37steps.com/prtools">PRTools Guide</a>, <a href="http://archive.ics.uci.edu/ml/">UCI Website</a>
 % PRTOOLS, DATASETS, MISVAL
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 
-function x = heart(val)
+function a = heart(val)
 
-prdatasets(mfilename,1,'http://prtools.tudelft.nl/prdatasets/heart.dat');
 if nargin<1
 	val = 'remove';
 end
-
-user.desc='The Cleveland database from the Heart Disease Databases from UCI.  The class disease-presence is used as target class. ';
-user.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/heart-cleveland/';
-cl = {'absent' 'present'};
-fl = {'age' 'sex' 'cp' 'trestbps' 'chol' 'fbs' 'restecg' ...
-	'thalach' 'exang' 'oldpeak' 'slope' 'ca' 'thal'};
-fd = {[0 inf; 0 inf] [0 1] [1 2 3 4] [0 inf; 0 inf] [0 inf; 0 inf] ...
+a = pr_loadmatfile;
+if isempty(a)
+  opt.labfeat   = 14;
+  opt.featnames = {'age' 'sex' 'cp' 'trestbps' 'chol' 'fbs' 'restecg' ...
+      'thalach' 'exang' 'oldpeak' 'slope' 'ca' 'thal'};
+  opt.classnames = {'absent' 'present'  'present'  'present'  'present'};
+	opt.desc='The Cleveland database from the Heart Disease Databases from UCI.  The class disease-presence is used as target class. ';
+	opt.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/heart-cleveland/';
+  opt.dsetname = 'Heart Cleveland';
+  a = pr_download('http://prtools.tudelft.nl/prdatasets/heart.dat',[],opt);
+  nlab = getnlab(a);
+  nlab(nlab>1) = 2;
+  a = setnlab(a,nlab);
+  a = remclass(a);
+  fd = {[0 inf; 0 inf] [0 1] [1 2 3 4] [0 inf; 0 inf] [0 inf; 0 inf] ...
       [0 1] [0 1 2] [0 inf; 0 inf] [0 1] [0 inf; 0 inf] [1 2 3] [-1 0 1 2 3] [3 6 7]};
-
-a = load('heart.dat');
-lab = (a(:,end)>0);
-x = pr_dataset(a(:,1:(end-1)),cl(lab+1));
-x = setfeatlab(x,fl);
-x = setname(x,'Heart Cleveland');
-x = setfeatdom(x,fd);
-[x,msg] = misval(x,val);
-user.desc = [user.desc msg];
-x = setuser(x,user);
+  x = setfeatdom(a,fd);
+  pr_savematfile(a);
+end
+[a,msg] = misval(a,val);
 
 return
Index: /prdatasets/hepatitis.m
===================================================================
--- /prdatasets/hepatitis.m	(revision 136)
+++ /prdatasets/hepatitis.m	(revision 137)
@@ -1,39 +1,38 @@
 %HEPATITIS 155 objects with 19 features in 2 classes
 %
-%             X = HEPATITIS
+%             A = HEPATITIS
 %
 % The hepatitis database from UCI to predict if the patient will live or
 % die.
 %
-%             X = HEPATITIS(VAL)
+%             A = HEPATITIS(VAL)
 %
 % By default objects with missing values are removed. When something else
 % is desired, use one of the options in MISVAL.
 %
-% SEE ALSO <a href="http://prtools.tudelft.nl/prtools">PRTools Guide</a>, <a href="http://archive.ics.uci.edu/ml/">UCI Website</a>
+% SEE ALSO <a href="http://37steps.com/prtools">PRTools Guide</a>, <a href="http://archive.ics.uci.edu/ml/">UCI Website</a>
 % PRTOOLS, DATASETS, MISVAL
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 
-function x = hepatitis(val);
+function a = hepatitis(val)
 
-prdatasets(mfilename,1,'http://prtools.tudelft.nl/prdatasets/hepatitis.dat');
 if nargin<1
-	val = 'remove';
+  val = 'remove';
 end
 
-user.desc = 'The hepatitis database from UCI to predict if the patient will live or die.';
-user.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/hepatitis/';
-cl = {'die' 'live'};
-fl = {'age' 'sex' 'steroid' 'antivirals' 'fatigue' 'malaise' ...
-'anorexia' 'liver big' 'liver firm' 'spleen palpable' 'spiders' ...
-'ascites' 'varices' 'bilirubin' 'alk phosphate' 'sgot' 'albumin' ...
-'protime' 'histology'};
-
-a = load('hepatitis.dat');
-x = pr_dataset(a(:,2:end),cl(a(:,1)));
-x = setfeatlab(x,fl);
-x = setname(x,'Hepatitis');
-[x,msg] = misval(x,val);
-user.desc = [user.desc msg];
-x = setuser(x,user);
+a = pr_loadmatfile;
+if isempty(a)
+  opt.delimeter = ' ';
+  opt.labfeat   = 1;
+  opt.featnames = {'age' 'sex' 'steroid' 'antivirals' 'fatigue' 'malaise' ...
+    'anorexia' 'liver big' 'liver firm' 'spleen palpable' 'spiders' ...
+    'ascites' 'varices' 'bilirubin' 'alk phosphate' 'sgot' 'albumin' ...
+    'protime' 'histology'};
+  opt.classnames = {'die' 'live'};
+  opt.desc = 'The hepatitis database from UCI to predict if the patient will live or die.';
+  user.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/hepatitis/';
+  opt.dsetname = 'Hepatitis Data Set';
+  a = pr_download('http://prtools.tudelft.nl/prdatasets/hepatitis.dat',[],opt);
+end
+a = misval(a,val);
Index: /prdatasets/imox.m
===================================================================
--- /prdatasets/imox.m	(revision 136)
+++ /prdatasets/imox.m	(revision 137)
@@ -10,12 +10,11 @@
 % See also DATASETS, PRDATASETS, X80
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
 
-function a = imox;
+function a = imox
 
-prdatasets(mfilename,1);
-a = pr_dataset('imox');
+a = pr_getdata;
 a = setname(a,'IMOX Dataset');
 a = setlablist(a,char('I','M','O','X'));
Index: /prdatasets/ionosphere.m
===================================================================
--- /prdatasets/ionosphere.m	(revision 136)
+++ /prdatasets/ionosphere.m	(revision 137)
@@ -11,5 +11,5 @@
 % See also DATASETS, PRDATASETS
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -17,8 +17,5 @@
 function a = ionosphere
 
-prdatasets(mfilename,1);
-% the stats toolbox has a ionosphere.mat file too, avoid it
-pp = fileparts(which(mfilename));
-a = pr_dataset(fullfile(pp,'ionosphere'));
+a = pr_getdata;
 a = setname(a,'Ionosphere Dataset');
 a = setlablist(a,{'good','bad'});
Index: /prdatasets/iris.m
===================================================================
--- /prdatasets/iris.m	(revision 136)
+++ /prdatasets/iris.m	(revision 137)
@@ -5,19 +5,17 @@
 % Iris plants dataset by R.A.Fisher, 150 objects, 4 features, 3
 % classes.
-function x = iris;
 
-prdatasets(mfilename,1,'http://prtools.tudelft.nl/prdatasets/iris.dat');
-user.desc = 'Iris Plant database from UCI. A classic dataset in the pattern recognition literature.  The original dataset is a multiclass classification problem, introduced by R.A. Fisher, The use of multiple measurements in taxonomic problems. Ann Eugenics, 7:179--188, 1936.';
-user.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/iris/';
-cl = {'Iris-setosa' 'Iris-versicolor' 'Iris-virginica'};
-fl = {'sepal length' 'sepal width' 'petal length' 'petal width'};
+function a = iris
 
-% the fuzzy toolbox has a iris.dat file too, avoid it
-pp = fileparts(which(mfilename));
-a = load(fullfile(pp,'iris.dat'));
-x = pr_dataset(a(:,1:(end-1)), cl(a(:,end)));
-x = setfeatlab(x,fl);
-x = setuser(x,user);
-x = setname(x,'Iris');
+a = pr_loadmatfile;
+if isempty(a)
+  opt.labfeat    = 5;
+  opt.featnames  = {'sepal length' 'sepal width' 'petal length' 'petal width'};
+  opt.classnames = {'Iris-setosa' 'Iris-versicolor' 'Iris-virginica'};
+  opt.desc       = 'Iris Plant database from UCI. A classic dataset in the pattern recognition literature.  The original dataset is a multiclass classification problem, introduced by R.A. Fisher, The use of multiple measurements in taxonomic problems. Ann Eugenics, 7:179--188, 1936.';
+  opt.link       = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/iris/';
+  opt.dsetname   = 'Iris';
+  a = pr_download('http://prtools.tudelft.nl/prdatasets/iris.dat',[],opt);
+end
 
 return
Index: /prdatasets/kimia.m
===================================================================
--- /prdatasets/kimia.m	(revision 136)
+++ /prdatasets/kimia.m	(revision 137)
@@ -11,15 +11,14 @@
 % See also DATASETS, PRDATASETS, PRDATAFILES, PRDATAFILES/KIMIA_IMAGES
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
 
-function a = kimia;
+function a = kimia
 
-prdatasets(mfilename,1);
+a = pr_getdata;
 labs = {'bone' 'glass' 'heart' 'misk' 'bird' 'brick' 'camel' ...
 	 'car' 'children' 'van' 'elephant' 'head' 'fork' 'fountain' ...
  	 'hammer' 'key' 'ray' 'turtle'};
-a = pr_dataset('kimia');
 a = setlablist(a,labs);
 a = setname(a,'Kimia Dataset');
Index: /prdatasets/lena.m
===================================================================
--- /prdatasets/lena.m	(revision 136)
+++ /prdatasets/lena.m	(revision 137)
@@ -8,5 +8,5 @@
 % See also DATASETS, PRDATASETS
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -14,7 +14,5 @@
 function a = lena
 
-prdatasets(mfilename,2);
-s = warning;
-a = pr_dataset('lena');
+a = pr_getdata;
 a = setfeatlab(a,['red  ';'green';'blue ']);
 a = setname(a,'Lena');
Index: /prdatasets/liver.m
===================================================================
--- /prdatasets/liver.m	(revision 136)
+++ /prdatasets/liver.m	(revision 137)
@@ -9,5 +9,5 @@
 % See also DATASETS, PRDATASETS
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -15,8 +15,6 @@
 function a = liver
 
-prdatasets(mfilename,1);
-a = pr_dataset('liver');
+a = pr_getdata;
 a = setname(a,'Liver disorder dataset');
-
 a = setlablist(a,char('healthy','disorder'));
 a = setfeatlab(a,char(...
Index: datasets/loadmatfile.m
===================================================================
--- /prdatasets/loadmatfile.m	(revision 136)
+++ 	(revision )
@@ -1,58 +1,0 @@
-%LOADMATFILE  Load matfile for this mfile, if it exist
-%
-%    A = LOADMATFILE(MATFILE)
-%
-% Loads the dataset stored in the matfile. Default matfile is the name of
-% the calling routine. The output A is empty if MATFILE does not exist.
-%
-%    [A1,A2,..] = LOADMATFILE(MATFILE,NARGOUTCOUNT)
-%
-% In case multiple matfiles are stored for the calling routine, it is
-% assumed they all contain a dataset: train set, test set, validation set,
-% etcetera. In case NARGOUTCOUNT (NARGOUT of the calling routine) equals 1,
-% the combined dataset is loaded and returned in A (A1). 
-% In case NARGOUTCOUNT > 1, the subsets are are loaded into A1, A2, ... 
-%
-% SEE ALSO
-% DATASETS, PRDATASETS, SAVEMATFILE, PR_DOWNLOAD_UCI
-
-function varargout = loadmatfile(name)
-
-varargout = cell(1,nargout);
-
-if nargin < 1 || isempty(name)
-  name = callername;
-end
-matfile = fullfile(fullfile(fileparts(which(name)),'data'),name);
-
-if nargout == 1
-  varargout{1} = loadmatf([matfile '.mat']);
-else
-  for i=1:nargout
-    varargout{i} = loadmatf([matfile '_' num2str(i) '.mat']);
-  end
-end
-
-return
-  
-function a = loadmatf(matfile)
-  if exist(matfile,'file') == 2
-    warning('OFF','MATLAB:indeterminateFields');
-    s = load(matfile);
-    warning('ON','MATLAB:indeterminateFields');
-    fields = fieldnames(s);
-    a = s.(fields{1});
-    a = pr_dataset(a); % take care of prtools4 and prtools5 datasets
-  else
-    a = [];
-  end
-return
-
-function name = callername
-  [ss,dummy] = dbstack;
-  if length(ss) < 3
-    name = [];
-  else
-    name = ss(3).name;
-  end
-return
Index: /prdatasets/malaysia.m
===================================================================
--- /prdatasets/malaysia.m	(revision 136)
+++ /prdatasets/malaysia.m	(revision 137)
@@ -8,11 +8,10 @@
 % See also DATASETS, PRDATASETS
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5038, 2600 GA Delft, The Netherlands
 
-function a = malaysia;
+function a = malaysia
 
-prdatasets(mfilename,1);
-a = pr_dataset('malaysia');
+a = pr_getdata;
 a = setname(a,'Malaysia Data');
Index: /prdatasets/mfeat.m
===================================================================
--- /prdatasets/mfeat.m	(revision 136)
+++ /prdatasets/mfeat.m	(revision 137)
@@ -24,5 +24,5 @@
 % MFEAT_PIX, MFEAT_ZER
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
Index: /prdatasets/mfeat_all.m
===================================================================
--- /prdatasets/mfeat_all.m	(revision 136)
+++ /prdatasets/mfeat_all.m	(revision 137)
@@ -19,5 +19,5 @@
 % See also DATASETS, PRDATASETS, 
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
Index: /prdatasets/mfeat_fac.m
===================================================================
--- /prdatasets/mfeat_fac.m	(revision 136)
+++ /prdatasets/mfeat_fac.m	(revision 137)
@@ -8,5 +8,5 @@
 % See also DATASETS, PRDATASETS, MFEAT
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -14,5 +14,4 @@
 function a = mfeat_fac
 
-prdatasets(mfilename,1);
-a = pr_dataset('mfeat_fac');
+a = pr_getdata;
 a = setname(a,'MFEAT Face Features');
Index: /prdatasets/mfeat_fou.m
===================================================================
--- /prdatasets/mfeat_fou.m	(revision 136)
+++ /prdatasets/mfeat_fou.m	(revision 137)
@@ -7,5 +7,5 @@
 % See also DATASETS, PRDATASETS, MFEAT
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -13,5 +13,4 @@
 function a = mfeat_fou
 
-prdatasets(mfilename,1);
-a = pr_dataset('mfeat_fou');
+a = pr_getdata;
 a = setname(a,'MFEAT Fourier Features');
Index: /prdatasets/mfeat_kar.m
===================================================================
--- /prdatasets/mfeat_kar.m	(revision 136)
+++ /prdatasets/mfeat_kar.m	(revision 137)
@@ -7,5 +7,5 @@
 % See also DATASETS, PRDATASETS, MFEAT
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -13,5 +13,4 @@
 function a = mfeat_kar
 
-prdatasets(mfilename,1);
-a = pr_dataset('mfeat_kar');
+a = pr_getdata;
 a = setname(a,'MFEAT KL Features');
Index: /prdatasets/mfeat_mor.m
===================================================================
--- /prdatasets/mfeat_mor.m	(revision 136)
+++ /prdatasets/mfeat_mor.m	(revision 137)
@@ -7,5 +7,5 @@
 % See also DATASETS, PRDATASETS, MFEAT
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -13,5 +13,4 @@
 function a = mfeat_mor
 
-prdatasets(mfilename,1);
-a = pr_dataset('mfeat_mor');
+a = pr_getdata;
 a = setname(a,'MFEAT Morphological Features');
Index: /prdatasets/mfeat_pix.m
===================================================================
--- /prdatasets/mfeat_pix.m	(revision 136)
+++ /prdatasets/mfeat_pix.m	(revision 137)
@@ -8,5 +8,5 @@
 % See also DATASETS, PRDATASETS, MFEAT
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -14,5 +14,4 @@
 function a = mfeat_pix
 
-prdatasets(mfilename,1);
-a = pr_dataset('mfeat_pix');
+a = pr_getdata;
 a = setname(a,'MFEAT Pixel Features');
Index: /prdatasets/mfeat_zer.m
===================================================================
--- /prdatasets/mfeat_zer.m	(revision 136)
+++ /prdatasets/mfeat_zer.m	(revision 137)
@@ -7,5 +7,5 @@
 % See also DATASETS, PRDATASETS, MFEAT
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -13,5 +13,4 @@
 function a = mfeat_zer
 
-prdatasets(mfilename,1);
-a = pr_dataset('mfeat_zer');
+a = pr_getdata;
 a = setname(a,'MFEAT Zernike Moments');
Index: /prdatasets/mnist8.m
===================================================================
--- /prdatasets/mnist8.m	(revision 136)
+++ /prdatasets/mnist8.m	(revision 137)
@@ -13,5 +13,5 @@
 % See also DATASETS, PRDATASETS
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -19,6 +19,5 @@
 function [a,b] = mnist8
 
-prdatasets(mfilename,1);
-a = pr_dataset('mnist8');
+a = pr_getdata;
 if nargout == 2
   b = a(60001:end,:);
Index: /prdatasets/nist16.m
===================================================================
--- /prdatasets/nist16.m	(revision 136)
+++ /prdatasets/nist16.m	(revision 137)
@@ -8,5 +8,5 @@
 % See also DATASETS, PRDATASETS
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -14,6 +14,5 @@
 function a = nist16
 
-prdatasets(mfilename,1);
-a = pr_dataset('nist16');
+a = pr_getdata;
 a = setname(a,'NIST16 Normalised Digits');
 
Index: /prdatasets/nist32.m
===================================================================
--- /prdatasets/nist32.m	(revision 136)
+++ /prdatasets/nist32.m	(revision 137)
@@ -7,5 +7,5 @@
 % See also DATASETS, PRDATASETS, NIST16
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -13,9 +13,7 @@
 
 function a = nist32(N)
+
 if nargin < 1, N = [0:9]; end
-a = pr_getdata('http://prtools.tudelft.nl/prdatasets/nist32.mat',1);
-
-% prdatasets(mfilename,1);
-% a = pr_dataset('nist32');
+a = pr_getdata;
 a = setname(a,'NIST32 Binary Digits');
 a = selclass(a,N+1);
Index: /prdatasets/pr_callername.m
===================================================================
--- /prdatasets/pr_callername.m	(revision 137)
+++ /prdatasets/pr_callername.m	(revision 137)
@@ -0,0 +1,16 @@
+%PR_CALLERNAME
+%
+% Needed here as it doen not exist in some old versions of PRTools
+%
+%   NAME = PR_CALLERNAME
+%
+% Returns the name of the calling function 
+
+function name = pr_callername
+
+[ss,i] = dbstack;
+if length(ss) < 3
+	name = [];
+else
+	name = ss(3).name;
+end
Index: /prdatasets/pr_cell2dset.m
===================================================================
--- /prdatasets/pr_cell2dset.m	(revision 137)
+++ /prdatasets/pr_cell2dset.m	(revision 137)
@@ -0,0 +1,107 @@
+%PR_CELL2DSET Construct dataset from a cell array having one feature per cell.
+%
+%   A = PR_CELL2DSET(C,F,M,L)
+%
+% INPUT
+%   C  Cell array with one cell per feature. Categorical features should
+%      be given by strings in a character array or as cellstrings (one
+%      object per cell) stored in the feature cell.
+%      Numerical features may either be stored as character arrays, cell
+%      strings or as a numeric vector.
+%      In case C is a 2D cell array columns are first combined into a
+%      cellstring or a vector.
+%   F  Format field (e.g. 'ccncnn') for distinguishing cell character
+%      arrays with categorical data ('c') from numeric data ('n').
+%   M  Optional character array with symbols used for missing values. The 
+%      empty string ('') will always be interpreted as a missing value.
+%   L  Labels that may be used for labelling A (numbers or strings, see
+%      PRDATASET). (optional)
+%
+% OUTPUT
+%   A  Dataset with categorical features numerically coded as indices in 
+%      the DATA field, pointing to the list on category names stored in the  
+%      FEATDOM field, see SETFEATDOM.
+%
+% DESCRIPTION
+% This routine is an alternative for PRDATASET in case data is given by
+% strings or numeric characters. The parameter F is optional. If not given
+% all character arrays and cell strings are interpreted as categorical.
+%
+% Missing data (empty strings), will be coded as a NaNs.
+%
+% SEE ALSO <a href="http://prtools.tudelft.nl/prtools">PRTools Guide</a>
+% DATASETS, SETFEATDOM, FEATTYPES, DSET2CELL, CAT2DSET, DSET2CELL
+
+% Copyright: R.P.W. Duin
+
+function a = pr_cell2dset(c,varargin)
+
+[f,misval,lab] = setdefaults(varargin,'',[],[]);
+
+if ~iscell(c)
+  error('Cell array expected')
+end
+
+if min(size(c)) > 1       % 2D cell array, make 1D
+  cc = cell(1,size(c,2));
+  for j=1:size(c,2)
+    try
+      x = cell2mat(c(:,j));
+      cc{1,j} = x;
+      f = [f 'n'];
+    catch
+      try
+        x = char(c(:,j));
+        cc{1,j} = x;
+        f = [f 'c'];
+      catch
+        cc{1,j} = NaN(size(c,1),1);
+        f = [f 'n'];
+      end
+    end
+  end
+  c = cc;
+end
+
+m = size(c{1},1);         % number of objects
+k = numel(c);             % number of features
+a = zeros(m,k);           % numeric data will be stored here
+if ~isempty(f)            % decode format statement
+  if numel(f) ~= k
+    error('format string has wrong size')
+  end
+else
+  f = repmat('x',1,k);    % indicates: no format given
+end
+
+fdom = cell(1,numel(c));  % space for feature domains
+for j=1:numel(c)          % run over all features
+  if size(c{j},1) ~= m
+    error('Not the same number of objects for all features')
+  end
+  if ischar(c{j}) || iscell(c{j})
+    cc = cellstr(c{j});
+    if ~isempty(misval)
+      for i=1:numel(misval)
+        L = find(strcmp(misval(i),cc));
+        cc(L) = [repmat({''},numel(L),1)];
+      end
+    end
+    L = find(strcmp('',cc));    % find missing values
+    if (f(j) == 'x') || (f(j) == 'c')
+      % interpret as category data, use renumlab for coding
+      [a(:,j),fdom{j}] = renumlab(cc);
+      a(L,j) = NaN(numel(L),1);
+    elseif f(j) == 'n'
+      cc(L) = [repmat({'NaN'},numel(L),1)]; % put a 'NaN' for missing
+      a(:,j) = str2num(char(cc)); % convert
+    else
+      error('Wrong format found')
+    end
+  else
+    a(:,j) = c{j};
+  end
+end
+    
+a = prdataset(a,lab);
+a = setfeatdom(a,fdom);
Index: /prdatasets/pr_dataset.m
===================================================================
--- /prdatasets/pr_dataset.m	(revision 136)
+++ /prdatasets/pr_dataset.m	(revision 137)
@@ -9,2 +9,4 @@
   [varargout{:}] = prdataset(varargin{:});
 end
+
+end
Index: /prdatasets/pr_download.m
===================================================================
--- /prdatasets/pr_download.m	(revision 136)
+++ /prdatasets/pr_download.m	(revision 137)
@@ -93,5 +93,5 @@
 %% find directory to be used
 if isempty(datname)
-  datname = callername;
+  datname = pr_callername;
   dirname = fullfile(fileparts(which(datname)),'data');
 else
@@ -212,5 +212,5 @@
   a = setname(a,opt.dsetname);
 else
-  a = setname(a,callername);
+  a = setname(a,pr_callername);
 end
 
@@ -224,14 +224,11 @@
 
 
-function ask_download(urlname,size)
+function ask_download(urlname,datsize)
 %% user controlled downloading
   global ASK
-  if isempty(ASK)
-    ASK = true;
-  end
-  
-  if ASK
-    if ~isempty(size) && size ~= 0
-      siz = ['(' num2str(size) ' MB)']; 
+  
+  if ASK && ~isempty(datsize) % ask only if datsize has been set
+    if datsize ~= 0
+      siz = ['(' num2str(datsize) ' MB)']; 
     else
       siz = '';
@@ -297,13 +294,4 @@
 return
 
-function name = callername
-%%
-[ss,~] = dbstack;
-if length(ss) < 3
-	name = [];
-else
-	name = ss(3).name;
-end
-
 function [a,new] = pr_download_old(url,varargin)
 %% This is the old version of pr_download, to be called from the old 
@@ -448,5 +436,5 @@
 disp('Parsing ...')
 c = mytextscan(fid,strrep(form,'n','s'),del,nhead);
-a = cell2dset(c,form,misval);
+a = pr_cell2dset(c,form,misval);
 
 if ~nosave % don't save if not needed (e.g. called by pr_download_uci)
Index: /prdatasets/pr_getdata.m
===================================================================
--- /prdatasets/pr_getdata.m	(revision 136)
+++ /prdatasets/pr_getdata.m	(revision 137)
@@ -10,9 +10,10 @@
 % If given, SIZE (in MByte) is displayed in the request.
 %
-% If available, the dataset DSET stored in FIELD is returned in OUT.
-% In case of a datafile DFILE, it is created, if necessary, with given TYPE
-% and returned in OUT. In case the download was successful but no dataset
-% or datfile could be created (e.g. because of empty TYPE) OUT is empty, 
-% otherwise an error is generated.
+% A mat-file returns a structure with fields pointing to stored variables.
+% If available, the dataset DSET stored in FIELD (default 1) is returned in
+% OUT. In case of a datafile DFILE, it is created, if necessary, with given
+% TYPE and returned in OUT. In case the download was successful but no
+% dataset or datfile could be created (e.g. because of empty TYPE) OUT is
+% empty, otherwise an error is generated.
 %
 % This is a low-level routine, typically used in COMMAND and not called
@@ -20,7 +21,8 @@
 % is constucted and returned to the user.
 %
-% SEE ALSO DATASETS, DATAFILES
+% SEE ALSO (<a href="http://37steps.com/prhtml/37tools.html">37tools Contents</a>)
+% DATASETS, DATAFILES
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 
 function out = pr_getdata(varargin)
@@ -33,7 +35,11 @@
 %  dset  : becomes full path and name of dataset
 %  ddir  : becomes full path of dataset
-name = callername;
+name = pr_callername;
 argin = setdefaults(varargin,[],[],[],[],true);
 [url,size,dset,field,ask] = deal(argin{:});
+
+if isempty(url)
+  url = ['http://prtools.tudelft.nl/prdatasets/' name '.mat'];
+end
 [dummy,uname,ext] = fileparts(url);
 
@@ -41,5 +47,5 @@
   ddir = pwd;
 else
-  ddir = fileparts(which(name));
+  ddir = fullfile(fileparts(which(name)),'data');
 end
 
@@ -117,5 +123,5 @@
   try
     s = prload(dsetmat);
-  catch 
+  catch ME
     out = 'error';
     return
@@ -143,11 +149,4 @@
 end
 
-function name = callername
-[ss,dummy] = dbstack;
-if length(ss) < 3
-	name = [];
-else
-	name = ss(3).name;
-end
 
 
Index: /prdatasets/pr_loadmatfile.m
===================================================================
--- /prdatasets/pr_loadmatfile.m	(revision 137)
+++ /prdatasets/pr_loadmatfile.m	(revision 137)
@@ -0,0 +1,49 @@
+%PR_LOADMATFILE  Load matfile for this mfile, if it exist
+%
+%    A = PR_LOADMATFILE(MATFILE)
+%
+% Loads the dataset stored in the matfile. Default matfile is the name of
+% the calling routine. The output A is empty if MATFILE does not exist.
+%
+%    [A1,A2,..] = PR_LOADMATFILE(MATFILE,NARGOUTCOUNT)
+%
+% In case multiple matfiles are stored for the calling routine, it is
+% assumed they all contain a dataset: train set, test set, validation set,
+% etcetera. In case NARGOUTCOUNT (NARGOUT of the calling routine) equals 1,
+% the combined dataset is loaded and returned in A (A1). 
+% In case NARGOUTCOUNT > 1, the subsets are are loaded into A1, A2, ... 
+%
+% SEE ALSO
+% DATASETS, PRDATASETS, PR_SAVEMATFILE, PR_DOWNLOAD_UCI
+
+function varargout = pr_loadmatfile(name)
+
+varargout = cell(1,nargout);
+
+if nargin < 1 || isempty(name)
+  name = pr_callername;
+end
+matfile = fullfile(fullfile(fileparts(which(name)),'data'),name);
+
+if nargout == 1
+  varargout{1} = loadmatf([matfile '.mat']);
+else
+  for i=1:nargout
+    varargout{i} = loadmatf([matfile '_' num2str(i) '.mat']);
+  end
+end
+
+return
+  
+function a = loadmatf(matfile)
+  if exist(matfile,'file') == 2
+    warning('OFF','MATLAB:indeterminateFields');
+    s = prload(matfile);
+    warning('ON','MATLAB:indeterminateFields');
+    fields = fieldnames(s);
+    a = s.(fields{1});
+    a = pr_dataset(a); % take care of prtools4 and prtools5 datasets
+  else
+    a = [];
+  end
+return
Index: /prdatasets/pr_readdataset.m
===================================================================
--- /prdatasets/pr_readdataset.m	(revision 136)
+++ /prdatasets/pr_readdataset.m	(revision 137)
@@ -11,5 +11,5 @@
 %               default is determined from first line, e.g. 'nncc' for two
 %               numeric and two categorical features, see SETFEATDOM and
-%               CELL2DSET
+%               PR_CELL2DSET
 %  NLAB       - feature to be interpreted as class label, default [].
 %
@@ -18,5 +18,5 @@
 %
 %SEE ALSO
-%DATASETS, SETFEATDOM, CELL2DSET
+%DATASETS, SETFEATDOM, PR_CELL2DSET
 
 % Copyright: R.P.W. Duin
@@ -39,5 +39,5 @@
   end
   c = mytextscan(fid,strrep(form,'n','s'),del,nhead);
-  a = cell2dset(c,form,misval);
+  a = pr_cell2dset(c,form,misval);
   if ~isempty(flab)
     a = feat2lab(a,flab);
Index: /prdatasets/pr_savematfile.m
===================================================================
--- /prdatasets/pr_savematfile.m	(revision 137)
+++ /prdatasets/pr_savematfile.m	(revision 137)
@@ -0,0 +1,39 @@
+%PR_SAVEMATFILE Save matfile(s) for calling mfile
+
+function varargout = pr_savematfile(varargin)
+% nout: number of outputs of calling function 
+%       nout = 1: combine all files into varargout{1}
+%       nout > 1: return separate files unchanged
+% For any nout, all combined and single datasets are stored
+
+name = pr_callername;
+matfile = fullfile(fullfile(fileparts(which(name)),'data'),name);
+
+varargout = cell(1,nargout);
+if nargin == 1
+  a = varargin{1};
+  save(matfile,'a');
+  varargout{1} = a;
+else
+  if nargout == 1
+    a = vertcat(varargin{:});
+    a = setname(a,name);
+    save(matfile,'a');
+    varargout{1} = a;
+    for i=1:nargin
+      a = varargin{i};
+      save([matfile '_' num2str(i)],'a');
+    end
+  else
+    a = vertcat(varargin{:});
+    a = setname(a,name);
+    save(matfile,'a');
+    for i=1:nargin
+      a = varargin{i};
+      save([matfile '_' num2str(i)],'a');
+    end
+    for i=1:nargout
+      varargout{i} = varargin{i};
+    end
+  end
+end
Index: /prdatasets/ringnorm.m
===================================================================
--- /prdatasets/ringnorm.m	(revision 136)
+++ /prdatasets/ringnorm.m	(revision 137)
@@ -13,5 +13,5 @@
 % See also DATASETS, PRDATASETS, TWONORM
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -19,6 +19,5 @@
 function a = ringnorm
 
-prdatasets(mfilename,1);
-a = pr_dataset('ringnorm');
+a = pr_getdata;
 a = setname(a,'Ringnorm Data');
 
Index: /prdatasets/satellite.m
===================================================================
--- /prdatasets/satellite.m	(revision 136)
+++ /prdatasets/satellite.m	(revision 137)
@@ -11,5 +11,5 @@
 % See also DATASETS, PRDATASETS, SOYBEAN1
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -17,5 +17,4 @@
 function a = satellite
 
-prdatasets(mfilename,1);
-a = pr_dataset('satellite');
+a = pr_getdata;
 a = setname(a,'Satellite dataset');
Index: /prdatasets/sonar.m
===================================================================
--- /prdatasets/sonar.m	(revision 136)
+++ /prdatasets/sonar.m	(revision 137)
@@ -8,16 +8,14 @@
 %metal cylinder and those bounced off a roughly cylindrical rock.
 
-function x = sonar
+function a = sonar
 
-prdatasets(mfilename,1,'http://prtools.tudelft.nl/prdatasets/sonar.dat');
-user.desc = 'The Sonar dataset from the undocumented databases from UCI. The task is to train a network to discriminate between sonar signals bounced off a metal cylinder and those bounced off a roughly cylindrical rock.';
-user.link = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/undocumented/connectionist-bench/sonar';
-cl = {'mines' 'rocks'};
-a = load('sonar.dat');
-
-x = pr_dataset(a(:,1:(end-1)),cl(a(:,end)));
-x = setname(x,'Sonar');
-x = setuser(x,user);
-
+a = pr_loadmatfile;
+if isempty(a)
+  opt.labfeat    = 61;
+  opt.classnames = {'mines' 'rocks'};
+  opt.desc       = 'The Sonar dataset from the undocumented databases from UCI. The task is to train a network to discriminate between sonar signals bounced off a metal cylinder and those bounced off a roughly cylindrical rock.';
+  opt.link       = 'ftp://ftp.ics.uci.edu/pub/machine-learning-databases/undocumented/connectionist-bench/sonar';
+  a = pr_download('http://prtools.tudelft.nl/prdatasets/sonar.dat',[],opt);
+end
 
 return
Index: /prdatasets/soybean1.m
===================================================================
--- /prdatasets/soybean1.m	(revision 136)
+++ /prdatasets/soybean1.m	(revision 137)
@@ -8,5 +8,5 @@
 % See also DATASETS, PRDATASETS, SOYBEAN2
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -14,6 +14,5 @@
 function a = soybean1
 
-prdatasets(mfilename,1);
-a = pr_dataset('soybean1');
+a = pr_getdata;
 a = setname(a,'Large soybean dataset');
 a = setlablist(a,char(...
Index: /prdatasets/soybean2.m
===================================================================
--- /prdatasets/soybean2.m	(revision 136)
+++ /prdatasets/soybean2.m	(revision 137)
@@ -8,5 +8,5 @@
 % See also DATASETS, PRDATASETS, SOYBEAN1
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -14,6 +14,5 @@
 function a = soybean2
 
-prdatasets(mfilename,1);
-a = pr_dataset('soybean2');
+a = pr_getdata;
 a = setname(a,'Small soybean dataset');
 a = setlablist(a,char(...
Index: /prdatasets/texturel.m
===================================================================
--- /prdatasets/texturel.m	(revision 136)
+++ /prdatasets/texturel.m	(revision 137)
@@ -15,5 +15,5 @@
 % See also DATASETS, PRDATASETS, TEXTURET
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -21,5 +21,4 @@
 function a = texturel
 
-prdatasets(mfilename,4);
-a = pr_dataset('texturel');
+a = pr_getdata;
 a = setname(a,'Texture Learning Set');
Index: /prdatasets/texturet.m
===================================================================
--- /prdatasets/texturet.m	(revision 136)
+++ /prdatasets/texturet.m	(revision 137)
@@ -15,5 +15,5 @@
 % See also DATASETS, PRDATASETS, TEXTUREL
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -21,5 +21,4 @@
 function a = texturet
 
-prdatasets(mfilename,4);
-a = pr_dataset('texturet');
+a = pr_getdata;
 a = setname(a,'Texture Test Set');
Index: /prdatasets/twonorm.m
===================================================================
--- /prdatasets/twonorm.m	(revision 136)
+++ /prdatasets/twonorm.m	(revision 137)
@@ -13,5 +13,5 @@
 % See also DATASETS, PRDATASETS, RINGNORM
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -19,6 +19,5 @@
 function a = twonorm
 
-prdatasets(mfilename,1);
-a = pr_dataset('twonorm');
+a = pr_getdata;
 a = setname(a,'Twonorm Data');
 
Index: /prdatasets/wine.m
===================================================================
--- /prdatasets/wine.m	(revision 136)
+++ /prdatasets/wine.m	(revision 137)
@@ -1,5 +1,5 @@
 %WINE Wine recognition dataset 178 objects with 13 features in 3 classes
 %
-%	A = WINE
+%  A = WINE
 %
 % Load the dataset in A. This dataset is taken from the UCI
@@ -8,5 +8,5 @@
 % See also DATASETS, PRDATASETS
 
-% Copyright: R.P.W. Duin
+% Copyright: R.P.W. Duin, r.p.w.duin@37steps.com
 % Faculty EWI, Delft University of Technology
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
@@ -14,11 +14,10 @@
 function a = wine
 
-url = 'http://prtools.tudelft.nl/prdatasets/wine.dat';
-%prdatasets(mfilename,1,'http://prtools.tudelft.nl/prdatasets/wine.dat');
-user.desc = 'These data are the results of a chemical analysis of wines grown in the same region in Italy but derived from three different cultivars.  The analysis determined the quantities of 13 constituents found in each of the three types of wines.';
-user.link = '';
-opt.user = user;
-opt.labfeat = 1;
-opt.featnames = char(...
+a = pr_loadmatfile;
+if isempty(a)
+  opt.delimeter = ',';
+  opt.desc      = 'These data are the results of a chemical analysis of wines grown in the same region in Italy but derived from three different cultivars.  The analysis determined the quantities of 13 constituents found in each of the three types of wines.';
+  opt.labfeat   = 1;
+  opt.featnames = char(...
         'alcohol', ...
         'malic acid', ...
@@ -34,25 +33,6 @@
         'OD280/OD315 of diluted wines', ...        
         'proline');
-a = pr_download(url,[],opt);
-
-% %a = load('wine.dat');
-% %a = pr_dataset(a(:,2:end),a(:,1));
-% a = feat2lab(a,1);
-% a = setname(a,'Wine recognition data');
-% a = setlablist(a,char('cultivar 1','cultivar 2','cultivar 3'));
-% a = setfeatlab(a,char(...
-%         'alcohol', ...
-%         'malic acid', ...
-%         'ash', ...
-% 	'alcalinity of ash', ...
-% 	'magnesium', ...
-% 	'total phenols', ...
-% 	'flavanoids', ...
-% 	'nonflavanoid phenols', ...    
-% 	'proanthocyanine', ...    
-% 	'color intensity', ...        
-% 	'hue', ...    
-% 	'OD280/OD315 of diluted wines', ...        
-%         'proline'));
-% a = setuser(a,user);
-
+  opt.classnames = {'cultivar 1','cultivar 2','cultivar 3'};
+  opt.dsetname   = 'Wine recognition data';
+  a = pr_download('http://prtools.tudelft.nl/prdatasets/wine.dat',[],opt);
+end
Index: /prdatasets/x80.m
===================================================================
--- /prdatasets/x80.m	(revision 136)
+++ /prdatasets/x80.m	(revision 137)
@@ -22,8 +22,7 @@
 % P.O. Box 5031, 2600 GA Delft, The Netherlands
 
-function a = x80;
+function a = x80
 
-prdatasets('80x',1);
-a = pr_dataset('80x');
+a = pr_getdata('http://prtools.tudelft.nl/prdatasets/80x.mat',1);
 a = setname(a,'80X Dataset');
 a = setlablist(a,char('8','0','X'));
