summaryrefslogtreecommitdiff
path: root/macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.sci
diff options
context:
space:
mode:
authorimushir2016-02-09 16:38:27 +0530
committerimushir2016-02-09 16:38:27 +0530
commitee5bf4d90f78673d1e4d5a9dd304ee53c503c085 (patch)
tree696221a8f8a3dffeb50d12ea287dfbdfab919fc6 /macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.sci
parent8ee41aca4183a0239b9cb220de3f159b1f0910fb (diff)
downloadscilab2c-ee5bf4d90f78673d1e4d5a9dd304ee53c503c085.tar.gz
scilab2c-ee5bf4d90f78673d1e4d5a9dd304ee53c503c085.tar.bz2
scilab2c-ee5bf4d90f78673d1e4d5a9dd304ee53c503c085.zip
Support for Servo motor for Arduino. Support for'diag' in c
Diffstat (limited to 'macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.sci')
-rw-r--r--macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.sci30
1 files changed, 30 insertions, 0 deletions
diff --git a/macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.sci b/macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.sci
new file mode 100644
index 00000000..45d74c3a
--- /dev/null
+++ b/macros/FunctionAnnotation/FA_SZ_COL_DIAG_IN_EX.sci
@@ -0,0 +1,30 @@
+function outsize =FA_SZ_COL_DIAG_IN_EX(insize,val)
+
+///////////////////////////////COLUMN SIZE FOR INSERT POSITION//////////////////
+
+
+
+ if((insize(1) == '1')) // If ROW size is 1
+ if(val == '0') then //For Oth position
+ outsize = insize(2); //COLUMN size is equal to COLUMN size
+ else // For ...-2,-1,1,2... position
+ outsize = string(eval(insize(2))+abs(eval(val)));// COLUMN size is equal to COLUMN size + absolute value of position(for 1*3 matrix and 2nd postion COLUMN size is (3+2)=5
+ end
+ elseif((insize(2) == '1')) // If COLUMN size is 1
+ if(val == '0') then //For Oth position
+ outsize = insize(1); //COLUMNS size is equal to ROW size
+ else // For ...-2,-1,1,2.... position
+ outsize = string(eval(insize(1))+abs(eval(val)));// COLUMN size is equal to ROW size + absolute value of position(for 3*1 matrix and 1st postion COLUMN size is (3+1)=4
+ end
+////////////////////////////////////////////////////////////////////////////////
+
+
+////////////////////////////COLUMN SIZE FOR EXTRACT POSITION////////////////////
+
+ else
+ outsize = '1'; // For extract condition COLUMN size is always ONE.
+ end
+
+////////////////////////////////////////////////////////////////////////////////
+
+endfunction