Mercurial > hg > human-echolocation-java-webapp
comparison src/TestEchoClass.java @ 23:73a60617e1a7
Moved the src and classes folders to the root of the workspace; renamed the classes folder to build
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Fri, 06 Dec 2013 12:51:59 +0000 |
parents | webapp/WEB-INF/src/TestEchoClass.java@1eb7ec525d3c |
children |
comparison
equal
deleted
inserted
replaced
22:41bc856ceaea | 23:73a60617e1a7 |
---|---|
1 import com.mathworks.toolbox.javabuilder.MWJavaObjectRef; | |
2 import com.mathworks.toolbox.javabuilder.MWNumericArray; | |
3 import com.mathworks.toolbox.javabuilder.MWStructArray; | |
4 import com.mathworks.toolbox.javabuilder.MWException; | |
5 | |
6 import uk.ac.soton.isvr.*; | |
7 | |
8 public class TestEchoClass { | |
9 public static void main(String[] args) { | |
10 //Instantiate Objects to null | |
11 MWStructArray Input = null; | |
12 | |
13 HumanEcho echo; | |
14 | |
15 try { | |
16 echo = new HumanEcho(); | |
17 | |
18 // Matlab structure: | |
19 // Input = struct('dist', 0.9, 'azim', 0, 'orient', 'horz', 'dirweight', 0.2, 'outputfname', 'foo.wav') | |
20 | |
21 String[] InputStructFields = {"dist", "azim", "orient", "dirweight", "outputfname"}; | |
22 Input = new MWStructArray(1, 1, InputStructFields); | |
23 Input.set("dist", 1, Double.valueOf(0.9)); | |
24 Input.set("azim", 1, Double.valueOf(0)); | |
25 Input.set("orient", 1, "horz"); | |
26 Input.set("dirweight", 1, Double.valueOf(0.2)); | |
27 Input.set("outputfname", 1, "yeah.wav"); | |
28 | |
29 | |
30 Object[] result = echo.simulateBinauralSignals(Input); | |
31 | |
32 // MWNumericArray array = (MWNumericArray)result[0]; | |
33 // square = (double[][])array.toArray(); | |
34 | |
35 } | |
36 catch(MWException e) { | |
37 e.printStackTrace(); | |
38 } | |
39 | |
40 } | |
41 | |
42 } |