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

« back to all changes in this revision

Viewing changes to examples/mex-examples/mex-with-objects/mexobjs.dia.ref

  • 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
 
 
2
exec startup.sce;
 
3
linking files 
 
4
generic_gateway.o 
 
5
mexfunction1.o 
 
6
mexfunction2.o 
 
7
mexfunction3.o 
 
8
mexfunction4.o 
 
9
mexfunction5.o 
 
10
mexfunction6.o 
 
11
mexfunction7.o 
 
12
mexfunction8.o 
 
13
mexfunction9.o 
 
14
mexfunction10.o 
 
15
mexfunction11.o 
 
16
mexfunction12.o 
 
17
mexfunction13.o 
 
18
 to create a shared executable
 
19
 
 
20
shared archive loaded
 
21
 
 
22
Linking generic_gateway 
 
23
 
 
24
Interface 0 generic_gateway
 
25
 
 
26
 
 
27
[p,q,r]=mexfunction1(1:4,'qwerty');
 
28
Warning: 
 
29
This function requires 2 inputs
 
30
 
 
31
 
 
32
 
 
33
 
 
34
if r~='qwerty' then bugmes();quit;end
 
35
 
 
36
[a,x]=mexfunction2(20,'x');
 
37
 
 
38
if a~=20 then bugmes();quit;end
 
39
 
 
40
A=rand(2,2);B=rand(2,3);
 
41
 
 
42
C=mexfunction3(A,B);
 
43
 
 
44
if norm(A*B-C) > %eps then bugmes();quit;end
 
45
 
 
46
p=mexfunction4(1:3,'x');
 
47
 
 
48
if p ~= poly(1:3,'x') then bugmes();quit;end
 
49
 
 
50
w1=mexfunction5(1:5);
 
51
 
 
52
if and(w1~=(1:5)) then bugmes();quit;end
 
53
 
 
54
w2=mexfunction6(1:5);
 
55
 
 
56
if and(w2~=(1:5)) then bugmes();quit;end
 
57
 
 
58
w=rand(2,3);w(10,15)=0;w=sparse(w);
 
59
 
 
60
mexfunction7(mtlb_sparse(w));
 
61
(1 , 1) = 0.560849 
 
62
 
 
63
(2 , 1) = 0.662357 
 
64
 
 
65
(1 , 2) = 0.726351 
 
66
 
 
67
(2 , 2) = 0.198514 
 
68
 
 
69
(1 , 3) = 0.544257 
 
70
 
 
71
(2 , 3) = 0.232075 
 
72
 
 
73
 
 
74
w=mexfunction8();
 
75
Rows 3; Columns 10
 
76
 
 
77
 
 
78
if w(1)~='123456789 ' then bugmes();quit;end
 
79
 
 
80
mexfunction9() // prints something calling disp
 
81
 
 
82
 A=[1,2;3,4]   
 
83
 
 
84
 
 
85
clear myvar;
 
86
 
 
87
A=mexfunction10() // search myvar
 
88
 A  =
 
89
 
 
90
 variable myvar not found   
 
91
 
 
92
if A<>"variable myvar not found" then bugmes();quit;end
 
93
 
 
94
myvar=1:45;
 
95
 
 
96
A=mexfunction10() // search myvar again
 
97
 A  =
 
98
 
 
99
 variable myvar found size=[1,45]   
 
100
 
 
101
if A<>"variable myvar found size=[1,45]" then bugmes();quit;end
 
102
 
 
103
 
 
104
 
 
105
mexfunction11() // creates A11 with a mexEvalString
 
106
 
 
107
if A11<>[1,2,3,4] then bugmes();quit;end
 
108
 
 
109
 
 
110
mexfunction12() // creates C with a WriteMatrix (<==> mxPutArray)
 
111
 
 
112
if C<>matrix(0:7,4,2) then bugmes();quit;end
 
113
 
 
114
 
 
115
mexfunction13() // creates X with a mexEvalString
 
116
 ans  =
 
117
 
 
118
 variable X found size=[1,3]   
 
119
 
 
120
// then try to get it with mexGetArray
 
121
 
 
122
if X<>[1,2,3] then bugmes();quit;end
 
123
 
 
124
 
 
125