File: for.cat

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-- 777 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

for(1)                         Scilab Function                         for(1)
NAME
  for - language keyword for loops

DESCRIPTION
  Used to define loops. Its syntax is:

  for variable=expression ,instruction, ,instruction,end

  for variable=expression do instruction, ,instruction,end

  If  expression is a matrix or a row vector, variable takes as values the
  values of each column of the matrix.

  Useful example : for variable=n1:step:n2,  ...,end

  If expression is a list variable takes as values the successive entries of
  the list.

EXAMPLE
  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