~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to examples/interface-tour/intex10c.c

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "stack-c.h"
 
2
 
 
3
/*****************************************
 
4
 *  Accessing the Scilab Stack 
 
5
 *     1- Accessing a Scilab Matrix (read and write) 
 
6
 *        by its name. 
 
7
 *****************************************/
 
8
 
 
9
int intex10c(fname)
 
10
     char* fname;
 
11
 
12
  int l1;
 
13
  static int minlhs=1, minrhs=0, maxlhs=1, maxrhs=0;
 
14
  static int m, n, lp;
 
15
  int k;
 
16
 
 
17
  CheckRhs(minrhs,maxrhs) ;
 
18
  CheckLhs(minlhs,maxlhs) ;
 
19
 
 
20
  /*
 
21
   * we want to acces scilab variable : param 
 
22
   * we can modify or read param with *stk(lp+k)
 
23
   */ 
 
24
 
 
25
  GetMatrixptr("param", &m, &n, &lp);
 
26
  CreateVar(1, "d",  &m, &n, &l1);
 
27
 
 
28
  for (k = 0; k < m*n ; ++k) 
 
29
    { 
 
30
      (*stk(l1+k)) = (*stk(lp+k));
 
31
    }
 
32
  
 
33
  LhsVar(1) = 1;
 
34
  return(0);
 
35
}
 
36