-1

I am a beginner in the field of Data Mining. I have a data which i need to process before visualizing any useful results. So I do the following:

  1. Preprocess data using Java Program ( Output : txt files) (Input: FileNames)
  2. Convert .txt files to .xls files ( Excel file)
  3. Import excel file in MATLAB
  4. Write Matlab Script to draw some plots on the imported data

I wish to automate this process by just pressing run button and then it happens automatically.

Please guide me how to integrate my work so instead of doing these 4 steps each time i just provide input file names and all the work is done in one go.

Thanks!

nfechner
  • 17,295
  • 7
  • 45
  • 64
Basmah
  • 829
  • 3
  • 13
  • 25

4 Answers4

1

You can use arbitrary Java classes from within MATLAB - it is supported to run user-defined classes and even pass data between them and MATLAB. This would give you the following benefits:

  • no need to write text files/XLS and then import them into matlab
  • write everything in one MATLAB script - that is what duffymo had in mind, just that you do not need any shell/batch processing. Everything is done in MATLAB
  • you could add a MATLAB-implemented GUI to handle the process

Have a look at this SO post for some insights.

Community
  • 1
  • 1
angainor
  • 11,760
  • 2
  • 36
  • 56
0

You want a scripting language: Windows command if you're on that platform; shell scripts on Linux.

It might not be a button, because that implies a UI. You have to write what amounts to an application for that.

duffymo
  • 305,152
  • 44
  • 369
  • 561
0

The java matlabcontrol library might come in handy http://code.google.com/p/matlabcontrol/

I had a similar task some time ago. Matlabcontrol is a library which connects MATLAB to your Java program and is quite easy to use.

Sander
  • 591
  • 6
  • 16
  • Thank you Sander :)! thats really cool. but unfortunately the performance is really slow :S! i just ran the following as given in the walk through code and it took 1-2 minutes for my laptop to give display. – Basmah Oct 19 '12 at 10:45
  • public static void main(String[] args) throws MatlabConnectionException, MatlabInvocationException { //Create a proxy, which we will use to control MATLAB MatlabProxyFactory factory = new MatlabProxyFactory(); MatlabProxy proxy = factory.getProxy(); //Display 'hello world' just like when using the demo proxy.eval("disp('hello world')"); //Disconnect the proxy from MATLAB proxy.disconnect(); } – Basmah Oct 19 '12 at 10:45
0

All steps can be done in Matlab environment.

Java code can be called in Matlab directly. Just add your java class path to Classpath.txt in Matlab and import in the script code.

Maybe CSV data file is better for your case.

Yuan
  • 1,147
  • 11
  • 16