summaryrefslogtreecommitdiff
path: root/src/Scilab2C/SCI2CTests/test999_WorkingDir/scilabcode/mainfunction.sci
diff options
context:
space:
mode:
authorjofret2008-06-06 15:07:30 +0000
committerjofret2008-06-06 15:07:30 +0000
commit3a19a1a1520a3f1c776564f0614755c70bdef9d7 (patch)
tree2506b8a2f5a42ba1d775805704edbce9458924ad /src/Scilab2C/SCI2CTests/test999_WorkingDir/scilabcode/mainfunction.sci
parentba22168165998d3beb67b311c8a141e8adc9c2af (diff)
downloadscilab2c-3a19a1a1520a3f1c776564f0614755c70bdef9d7.tar.gz
scilab2c-3a19a1a1520a3f1c776564f0614755c70bdef9d7.tar.bz2
scilab2c-3a19a1a1520a3f1c776564f0614755c70bdef9d7.zip
Test files.
Ignore generated directories C_code and Temp.
Diffstat (limited to 'src/Scilab2C/SCI2CTests/test999_WorkingDir/scilabcode/mainfunction.sci')
-rw-r--r--src/Scilab2C/SCI2CTests/test999_WorkingDir/scilabcode/mainfunction.sci29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/Scilab2C/SCI2CTests/test999_WorkingDir/scilabcode/mainfunction.sci b/src/Scilab2C/SCI2CTests/test999_WorkingDir/scilabcode/mainfunction.sci
new file mode 100644
index 00000000..bfb5fc3f
--- /dev/null
+++ b/src/Scilab2C/SCI2CTests/test999_WorkingDir/scilabcode/mainfunction.sci
@@ -0,0 +1,29 @@
+//SCI2C: DEFAULT_PRECISION= DOUBLE
+
+function mainfunction()
+
+// ------------------------------
+// --- Simple Scalar Addition ---
+// ------------------------------
+a = 1;
+b = 2;
+c = 0;
+c = a + b;
+disp(c);
+
+// ------------------------------
+// --- Trigonometric Identity ---
+// ------------------------------
+x = (1:3)' * (4:9);
+y = (sin(x).^2) + (cos(x).^2);
+disp(x);
+disp(y-ones(3,6));
+
+// -------------------------------
+// --- Computation of Distance ---
+// -------------------------------
+// generate a vector w
+w = cos(sin(cos(x*3)*2).* x+ones(3,6).*cos(x-sin(y*2)));
+distxw = sqrt(x.^2 + w.^2);
+disp(distxw);
+endfunction