From cc3692b32093a20876c898a5ab4a9aa40a15822c Mon Sep 17 00:00:00 2001 From: bilderbuchi Date: Sun, 3 Jul 2011 18:44:32 +0800 Subject: [PATCH] Add simple test fixtures for Matlab. --- test/fixtures/matlab_function.m | 9 +++++++++ test/fixtures/matlab_script.m | 12 ++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 test/fixtures/matlab_function.m create mode 100644 test/fixtures/matlab_script.m diff --git a/test/fixtures/matlab_function.m b/test/fixtures/matlab_function.m new file mode 100644 index 00000000..b73502e2 --- /dev/null +++ b/test/fixtures/matlab_function.m @@ -0,0 +1,9 @@ +function ret = matlab_function(A,B) +% Simple function adding two values and displaying the return value + +ret = A+B; +% Display the return value +disp('Return value in function'); +disp(ret); + + diff --git a/test/fixtures/matlab_script.m b/test/fixtures/matlab_script.m new file mode 100644 index 00000000..89f1d956 --- /dev/null +++ b/test/fixtures/matlab_script.m @@ -0,0 +1,12 @@ +% Matlab example script + +%Call matlab_function function which resides in the same directory + +value1 = 5 % semicolon at end of line is not mandatory, only suppresses output to command line. +value2 = 3 + +% Calculate sum of value1 and value2 +result = matlab_function(value1,value2); + +disp('called from script') +disp(result);