summaryrefslogtreecommitdiffstats
path: root/scilab_doc
diff options
context:
space:
mode:
authorFarid Belahcene <farid.belahcene@inria.fr>2006-09-01 09:59:43 +0000
committerFarid Belahcene <farid.belahcene@inria.fr>2006-09-01 09:59:43 +0000
commitf32230641df0649eb5b4811d573370c3df3467bb (patch)
tree97e8d53cb322e7dd340ec8ba7a9a6e92cebc9190 /scilab_doc
parent6e24b7d4ade940b15613a930f85f61f863208545 (diff)
downloadscilab-f32230641df0649eb5b4811d573370c3df3467bb.zip
scilab-f32230641df0649eb5b4811d573370c3df3467bb.tar.gz
New modifications
Diffstat (limited to 'scilab_doc')
-rw-r--r--scilab_doc/toolbox_guide/toolbox_example/macros/foo1.sci34
1 files changed, 17 insertions, 17 deletions
diff --git a/scilab_doc/toolbox_guide/toolbox_example/macros/foo1.sci b/scilab_doc/toolbox_guide/toolbox_example/macros/foo1.sci
index 60743b4..5268642 100644
--- a/scilab_doc/toolbox_guide/toolbox_example/macros/foo1.sci
+++ b/scilab_doc/toolbox_guide/toolbox_example/macros/foo1.sci
@@ -1,18 +1,18 @@
1function [X]=foo1(A) 1function [X]=foo1(A)
2// This function returns the positive components fo A diagonal 2 // This function returns the positive components of the A diagonal
3 3
4// Check the type and the size of A 4 // Check the type and the size of A
5if type(A)<>1 then 5 if type(A)<>1 then
6 error("type of input argument must be a double"); 6 error("type of input argument must be a double");
7end 7 end
8if size(A,1)<>size(A,2) then 8 if size(A,1)<>size(A,2) then
9 error("input argument must be square matrix"); 9 error("input argument must be a square matrix");
10end 10 end
11//extraction of the positive components 11 //Extraction of the positive components
12X=[]; 12 X=[];
13for i=1:size(A,1) 13 for i=1:size(A,1)
14 if A(i,i)>0 then 14 if A(i,i)>0 then
15 X($+1)=A(i,i); 15 X($+1)=A(i,i);
16 end 16 end
17end 17 end
18endfunction 18endfunction \ No newline at end of file