diff options
author | Farid Belahcene <farid.belahcene@inria.fr> | 2006-09-01 09:59:43 +0000 |
---|---|---|
committer | Farid Belahcene <farid.belahcene@inria.fr> | 2006-09-01 09:59:43 +0000 |
commit | f32230641df0649eb5b4811d573370c3df3467bb (patch) | |
tree | 97e8d53cb322e7dd340ec8ba7a9a6e92cebc9190 /scilab_doc | |
parent | 6e24b7d4ade940b15613a930f85f61f863208545 (diff) | |
download | scilab-f32230641df0649eb5b4811d573370c3df3467bb.zip scilab-f32230641df0649eb5b4811d573370c3df3467bb.tar.gz |
New modifications
Diffstat (limited to 'scilab_doc')
-rw-r--r-- | scilab_doc/toolbox_guide/toolbox_example/macros/foo1.sci | 34 |
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 @@ | |||
1 | function [X]=foo1(A) | 1 | function [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 |
5 | if 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"); |
7 | end | 7 | end |
8 | if 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"); |
10 | end | 10 | end |
11 | //extraction of the positive components | 11 | //Extraction of the positive components |
12 | X=[]; | 12 | X=[]; |
13 | for 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 |
17 | end | 17 | end |
18 | endfunction | 18 | endfunction \ No newline at end of file |