File Exchange

image thumbnail

mweka: Running Machine Learning Tool Weka from MATLAB

version (2.51 MB) by Durga Lal Shrestha
Runs Machine Learning Tool Weka from MATLAB


Updated 12 Sep 2012

View License

This GUI runs the weka classifiers and displays the results in MATLAB.


1. Command line options for running weka
2. Demonstrate how to change classifier option using java class (similiar to GenericObjectEditor in weka)
3. Read and Write ARFF file to/from MATLAB
4. Able to select attributes from GUI to test with different input combinations
4. Show results graphically immediately
5. Easy to compare the results graphically for different runs
6. Bottom figures of the visualization panels show the dynamic zoom of the upper part

This tool demonstrates the following gui tricks among the others

1. How to write memo
2. How to use list box for displaying the results of different runs
3. How to code mouse movement

You can find many more other tricks in this program.


1. Works only with numerical prediction
2. Test options - training and test set (i.e. no cross-validation option etc)
3. Designed to work with weka-3-2, however it is easy to update for the new versions

Cite As

Durga Lal Shrestha (2020). mweka: Running Machine Learning Tool Weka from MATLAB (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

Ali Mia

First of all,thank you for writing an app of weka for matlab. I have a question about model files generated by weka with an extension of .model.
Is there a way to import the model file into Matlab by using your app?

Omer Eilam

I tried using the arffRead function and got the following error:

>> arffRead('my_example.arff')
Subscripted assignment dimension mismatch.

Error in arffRead (line 138)
data(i,:) = str2num(strData{i});

Does anybody know what seems to be the problem?


Omer Eilam

I tried using the example in the installation file and got the following error:

Cannot find an exact (case-sensitive) match for 'arffWrite'.
Do you want: arffwrite
(in C:\Program Files\MWEKA\arffwrite.m)?

Error in mweka>pushbutton_run_Callback (line 247)

Error in gui_mainfcn (line 96)

Error in mweka (line 43)
gui_mainfcn(gui_State, varargin{:});

Error in

Error while evaluating uicontrol Callback

Does anybody know what seems to be the problem?


Rob Campbell

arffwrite does not have a usage example.

Great initiative


Updated to include an App file for R2012b

Update of title and summary

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags