Mercurial > hg > human-echolocation-java-webapp
comparison webapp/WEB-INF/src/TestEchoClass.java @ 4:f6cffd6abce3
copies the generated jar to the correct lib folder.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Wed, 27 Nov 2013 17:24:31 +0000 |
parents | b6acfffd25cd |
children | ac4aa1922f32 |
comparison
equal
deleted
inserted
replaced
3:747ae11a8af8 | 4:f6cffd6abce3 |
---|---|
1 import com.mathworks.toolbox.javabuilder.MWJavaObjectRef; | 1 import com.mathworks.toolbox.javabuilder.MWJavaObjectRef; |
2 import com.mathworks.toolbox.javabuilder.MWNumericArray; | 2 import com.mathworks.toolbox.javabuilder.MWNumericArray; |
3 import com.mathworks.toolbox.javabuilder.MWStructArray; | |
3 import com.mathworks.toolbox.javabuilder.MWException; | 4 import com.mathworks.toolbox.javabuilder.MWException; |
4 | 5 |
5 import uk.ac.soton.isvr.*; | 6 import uk.ac.soton.isvr.*; |
6 | 7 |
7 public class TestEchoClass { | 8 public class TestEchoClass { |
8 | |
9 int test = 4; | 9 int test = 4; |
10 | 10 double[][] square = new double[0][]; |
11 double[][] square = new double[0][]; | |
12 | |
13 | 11 |
14 public static void main(String[] args) { | 12 public static void main(String[] args) { |
15 System.out.println("YOOOOOO, Bs"); | 13 System.out.println("YOOOOOO, Bs"); |
16 | 14 |
15 //Instantiate Objects to null | |
16 MWStructArray Input = null; | |
17 | |
17 HumanEcho echo; | 18 HumanEcho echo; |
19 | |
18 | 20 |
19 try { | 21 try { |
20 echo = new HumanEcho(); | 22 echo = new HumanEcho(); |
21 Object[] result = echo.gen_echo(1); | |
22 | 23 |
23 MWNumericArray array = (MWNumericArray)result[0]; | 24 // Matlab function: |
24 //square = (double[][])array.toArray(); | 25 // a = struct('dist', 0.9, 'azim', 0, 'orient', 'horz', 'dirweight', 0.2) |
25 | 26 |
26 } | 27 // package input into MW Structure Array |
27 catch(MWException e) { | 28 String[] InputStructFields = {"dist", "azim", "orient", "dirweight"}; |
28 e.printStackTrace(); | 29 Input = new MWStructArray(1, 1, InputStructFields); |
29 } | 30 Input.set("dist", 1, 0.9); |
31 Input.set("azim", 1, "azim"); | |
32 Input.set("orient", 1, "horz"); | |
33 Input.set("dirweight", 1, 0.2); | |
34 | |
35 Object[] result = echo.simulateBinauralSignals(Input); | |
36 | |
37 MWNumericArray array = (MWNumericArray)result[0]; | |
38 //square = (double[][])array.toArray(); | |
39 | |
40 } | |
41 catch(MWException e) { | |
42 e.printStackTrace(); | |
43 } | |
30 | 44 |
31 } | 45 } |
32 | 46 |
33 } | 47 } |