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

« back to all changes in this revision

Viewing changes to examples/interface-tour-so/ex17intc.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
 * Shows how to back convert data to Scilab internal formal 
 
5
 * when data was modified when extracted (for example when 
 
6
 * using 'i','r','z' in GetRhsVar ) 
 
7
 **************************************************/
 
8
 
 
9
int intex17c_1(fname)
 
10
  char* fname;
 
11
 
12
  int m,n,m1,n1,l1,m2,n2,l2,m3,n3,l3,m4,n4,l4,m5,n5,l5;
 
13
  int it1,lc1, l;
 
14
 
 
15
  CheckRhs(1,1);
 
16
  CheckLhs(1,1);
 
17
 
 
18
  GetRhsVar(1,"l",&m,&n,&l);
 
19
  CheckLength(1,m,5);
 
20
  GetListRhsCVar(1,1,"i",&it1,&m1,&n1,&l1,&lc1);
 
21
  GetListRhsVar(1,2,"i",&m2,&n2,&l2);
 
22
  GetListRhsVar(1,3,"c",&m3,&n3,&l3);
 
23
  GetListRhsVar(1,4,"r",&m4,&n4,&l4);
 
24
  GetListRhsVar(1,5,"z",&m5,&n5,&l5);
 
25
 
 
26
  /* first list argument cannot be returned directly 
 
27
   * since the previous GetListRhsVar have performed 
 
28
   * data conversion. But we can back-convert data 
 
29
   * before returning the list. 
 
30
   */ 
 
31
 
 
32
  /* Backconvert to scilab internal default format */
 
33
 
 
34
  ConvertData("i",m1*n1*(it1+1),l1);
 
35
  ConvertData("i",m2*n2,l2);
 
36
  ConvertData("c",m3*n3,l3);
 
37
  ConvertData("r",m4*n4,l4);
 
38
  ConvertData("z",m5*n5,l5);
 
39
 
 
40
  LhsVar(1)=1;
 
41
  return(0);
 
42
}