File: for.man

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (28 lines) | stat: -rw-r--r-- 823 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
.TH for 1 "April 1993" "Scilab Group" "Scilab Function"
.so ../sci.an
.SH NAME
for - language keyword for loops
.SH DESCRIPTION
Used to define loops. Its syntax is:
.LP
.Vb for variable=expression ,instruction,   ,instruction,end
.LP
.Vb for variable=expression do instruction,   ,instruction,end
.LP
If  \fVexpression\fR is a matrix or a row vector, \fVvariable\fR
takes as values the values of each column of the matrix.
.LP
Useful example : \fVfor variable=n1:step:n2,  ...,end\fR
.LP
If \fVexpression\fR is a list \fVvariable\fR takes as values the
successive entries of the list.
.SH EXAMPLE
.nf
n=5;
for i = 1:n, for j = 1:n, a(i,j) = 1/(i+j-1);end;end
for j = 2:n-1, a(j,j) = j; end; a
for  e=eye(3,3),e,end  
for v=a, write(6,v),end        
for j=1:n,v=a(:,j), write(6,v),end 
for l=list(1,2,'example'); l,end 
.fi