title: Linking weka to matlab
body: <p>I have written this code in Matlab to link weka with matlab so that i can implement Genetic Algorithm</p>
  
  <pre><code>enter code here
  import java.util.*
  import java.util.Enumeration
  import java.lang.String
  import weka.classifiers.*
  import weka.classifiers.Evaluation
  import weka.classifiers.trees.J48
  import java.io.FileReader               
  import weka.core.Instances
  import weka.core.Utils
  import weka.core.Attribute
  import java.lang.System
  
  javaaddpath('C:\Users\sagnik\Documents\MATLAB\GA\weka.jar');
  
  clear all
  clc
  v1 = java.lang.String('-t');
  v2 = java.lang.String('C:\Users\sagnik\Documents\MATLAB\GA\generateTrainDiv.csv');
  
  v3 = java.lang.String('-T');
  v4 = java.lang.String('C:\Users\sagnik\Documents\MATLAB\GA\generateTestDiv.csv');
  
  prm = cat(1,v1,v2,v3,v4);
  classifier = javaObject('weka.classifiers.functions.MultilayerPerceptron');
  weka.classifiers.Evaluation.evaluateModel(classifier,prm);
  </code></pre>
  
  <p>But this is giving error in the last line as:</p>
  
  <pre><code>Java exception occurred:
  java.lang.Exception:
  Weka exception: Can't open file null.
  at weka.classifiers.Evaluation.evaluateModel(Evaluation.java:1080)
  </code></pre>
  
  <p>Please somenone help me,how to fix this! How is the filename 'null' here..I have already provided the 2 filenames..</p>