summaryrefslogtreecommitdiff
path: root/Tutorial1/Scilab_code/Tutorial1_function.sce
diff options
context:
space:
mode:
authorChayan Bhawal2018-09-27 09:45:14 +0530
committerChayan Bhawal2018-09-27 09:45:14 +0530
commit5f24e94950f3d3f059cb266309cb5b07b7ecdb32 (patch)
tree5e327bde32c371abe68850ae77af138ed4b950b0 /Tutorial1/Scilab_code/Tutorial1_function.sce
parentad60e147f47b699b3d4953a1901e3c2742013e59 (diff)
downloadscilab-tutorials-5f24e94950f3d3f059cb266309cb5b07b7ecdb32.tar.gz
scilab-tutorials-5f24e94950f3d3f059cb266309cb5b07b7ecdb32.tar.bz2
scilab-tutorials-5f24e94950f3d3f059cb266309cb5b07b7ecdb32.zip
Tutorial1_functions_filehandling
Diffstat (limited to 'Tutorial1/Scilab_code/Tutorial1_function.sce')
-rw-r--r--Tutorial1/Scilab_code/Tutorial1_function.sce27
1 files changed, 27 insertions, 0 deletions
diff --git a/Tutorial1/Scilab_code/Tutorial1_function.sce b/Tutorial1/Scilab_code/Tutorial1_function.sce
new file mode 100644
index 0000000..164430c
--- /dev/null
+++ b/Tutorial1/Scilab_code/Tutorial1_function.sce
@@ -0,0 +1,27 @@
+//This Matlab script is used to compute mean and standard deviation of data
+
+//Clears all previous variables stored
+clear
+
+//Clears screen
+clc
+
+
+//Executing the mymean function that computes the mean of a given data
+exec mymean.sci;
+//Executing the mystdev function that computes the standard deviation of a given data
+exec mystdev.sci;
+
+
+//Data for which the mean and standard-deviation is required
+x = [1 2 5];
+
+//Calling the mymean function. It takes data (a vector) as the input argument and returns mean of the data as output
+mean_of_x = mymean(x);
+disp(mean_of_x,'Mean of x');
+
+//Calling the mystdev function. It takes data (a vector) and its mean as the input argument
+//It returns standard deviation of the data as output
+stddev_of_x = mystdev(x,mean_of_x);
+disp(stddev_of_x,'Standard deviation of x');
+