diff options
author | jofret | 2009-04-28 07:11:01 +0000 |
---|---|---|
committer | jofret | 2009-04-28 07:11:01 +0000 |
commit | b22f596ce449869bffd8e0f63baee1c53e20fa06 (patch) | |
tree | 24e5c3ca47f535b5340a969edf31b774b356848b /macros/FunctionAnnotation/FA_ADD.sci | |
parent | f96b66fe2423831bcad2f141469de6805364d019 (diff) | |
download | scilab2c-b22f596ce449869bffd8e0f63baee1c53e20fa06.tar.gz scilab2c-b22f596ce449869bffd8e0f63baee1c53e20fa06.tar.bz2 scilab2c-b22f596ce449869bffd8e0f63baee1c53e20fa06.zip |
Moving macros here
Diffstat (limited to 'macros/FunctionAnnotation/FA_ADD.sci')
-rw-r--r-- | macros/FunctionAnnotation/FA_ADD.sci | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/macros/FunctionAnnotation/FA_ADD.sci b/macros/FunctionAnnotation/FA_ADD.sci new file mode 100644 index 00000000..1973f8d7 --- /dev/null +++ b/macros/FunctionAnnotation/FA_ADD.sci @@ -0,0 +1,43 @@ +function opout = FA_ADD(in1,in2)
+// function opout = FA_ADD(in1,in2)
+// -----------------------------------------------------------------
+// Addition function for Function Annotations.
+//
+// Input data:
+// in1: string specifying a number or a symbol.
+// in2: string specifying a number or a symbol.
+//
+// Output data:
+// opout: string containing the computed result.
+//
+// Status:
+// 26-Oct-2007 -- Raffaele Nutricato: Author.
+// 26-Oct-2007 -- Alberto Morea: Test Ok.
+//
+// Copyright 2007 Raffaele Nutricato & Alberto Morea.
+// Contact: raffaele.nutricato@tiscali.it
+// -----------------------------------------------------------------
+
+// ------------------------------
+// --- Check input arguments. ---
+// ------------------------------
+SCI2CNInArgCheck(argn(2),2,2);
+
+
+// ------------------------
+// --- Generate Output. ---
+// ------------------------
+if (SCI2Cisnum(in1) & SCI2Cisnum(in2))
+ in1num = eval(in1);
+ in2num = eval(in2);
+ outnum = in1num+in2num;
+ if isnan(outnum)
+ opout = '__SCI2CNANSIZE';
+ else
+ opout = string(outnum);
+ end
+else
+ opout = string('('+in1+'+'+in2+')');
+end
+
+endfunction
|