Java Class Error

Problem: When I try to run a WFDB command in MATLAB I get the following error:

>> r = rdsamp('mitdb/100', 'maxt', ':10');
Undefined variable "LoadWFDBJava" or class "LoadWFDBJava.load".

Error in rdsamp (line 74)
LoadWFDBJava.load;

Solution: You did not complete the installation of the toolbox. To complete installation follow these steps (note: the steps assume a Windows OS and a user name "wfdbtest"; similar steps for your Operating Systems can be found when you run the install script wfdb_install):

  1. Copy the file from
    C:\Users\wfdbtest\.wfdb-swig-matlab\0.0.3\librarypath.txt
    to
    C:\Program Files\MATLAB\R2012a\toolbox\local\librarypath.txt
    (or to your MATLAB startup directory for a local installation). You can copy the files from within the MATLAB prompt by using the following command:
      copyfile('C:\Users\wfdbtest\.wfdb-swig-matlab\0.0.3\librarypath.txt','C:\Program Files\MATLAB\R2012a\toolbox\local\librarypath.txt','f')
    
  2. Copy the file from
    C:\Users\wfdbtest\.wfdb-swig-matlab\0.0.3\classpath.txt
    to
    C:\Program Files\MATLAB\R2012a\toolbox\local\classpath.txt
    (or to your MATLAB startup directory for a local installation). You can copy the files from within the MATLAB prompt by using the following command:
      copyfile('C:\Users\wfdbtest\.wfdb-swig-matlab\0.0.3\classpath.txt','C:\Program Files\MATLAB\R2012a\toolbox\local\classpath.txt','f')