14feea4b944eda6e6ed903dc2a4544b7e2810ca9
1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) ????-2008 - INRIA
4 //
5 //  This file is distributed under the same license as the Scilab package.
6 // =============================================================================
7 format('v',10)
8 //display of numbers
9 x=2.6533333
10  x  =
12     2.6533333
13 x=[2.6533333 -0.0002]
14  x  =
16     2.6533333  - 0.0002
17 x'
18  ans  =
20     2.6533333
21   - 0.0002
22 x=[]
23  x  =
25      []
26 //display of polynomials
27 z=poly(0,'z')
28  z  =
30     z
31 num=[ (((((1)*z-2.6533333)*z+2.6887936)*z-1.2916784)*z+0.2911572)*...
32      z-0.0243497
33       (((((1)*z-2.6533333)*z+2.6887936)*z-1.2916784)*z+0.2911572)*...
34      z-0.0243497
35      (((1)*z )*z )*z+1
36      0]
37  num  =
39                                        2            3            4
40   - 0.0243497 + 0.2911572z - 1.2916784z + 2.6887936z - 2.6533333z
41                5
42             + z
44                                        2            3            4
45   - 0.0243497 + 0.2911572z - 1.2916784z + 2.6887936z - 2.6533333z
46                5
47             + z
49          3
50     1 + z
52     0
53 den = [ ((((1)*z-1.536926)*z+0.8067352)*z-0.1682810)*z+0.0113508
54 ((((1)*z-1.536926)*z+0.8067352)*z-0.1682810)*z+0.0113508
55 ((1)*z )*z
56 1]
57  den  =
59                                       2           3   4
60     0.0113508 - 0.168281z + 0.8067352z - 1.536926z + z
62                                       2           3   4
63     0.0113508 - 0.168281z + 0.8067352z - 1.536926z + z
65      2
66     z
68     1
69 num',den'
70  ans  =
73          column 1
75                                        2            3            4
76   - 0.0243497 + 0.2911572z - 1.2916784z + 2.6887936z - 2.6533333z
77                5
78             + z
80          column 2
82                                        2            3            4
83   - 0.0243497 + 0.2911572z - 1.2916784z + 2.6887936z - 2.6533333z
84                5
85             + z
87          column 3 to 4
89          3
90     1 + z     0
91  ans  =
94          column 1
96                                       2           3   4
97     0.0113508 - 0.168281z + 0.8067352z - 1.536926z + z
99          column 2 to 4
101                                       2           3   4     2
102     0.0113508 - 0.168281z + 0.8067352z - 1.536926z + z     z     1
103 [num;den]
104  ans  =
106                                        2            3            4
107   - 0.0243497 + 0.2911572z - 1.2916784z + 2.6887936z - 2.6533333z
108                5
109             + z
111                                        2            3            4
112   - 0.0243497 + 0.2911572z - 1.2916784z + 2.6887936z - 2.6533333z
113                5
114             + z
116          3
117     1 + z
119     0
121                                       2           3   4
122     0.0113508 - 0.168281z + 0.8067352z - 1.536926z + z
124                                       2           3   4
125     0.0113508 - 0.168281z + 0.8067352z - 1.536926z + z
127      2
128     z
130     1
131 [num den]
132  ans  =
135          column 1
137                                        2            3            4
138   - 0.0243497 + 0.2911572z - 1.2916784z + 2.6887936z - 2.6533333z
139                5
140             + z
142                                        2            3            4
143   - 0.0243497 + 0.2911572z - 1.2916784z + 2.6887936z - 2.6533333z
144                5
145             + z
147          3
148     1 + z
150     0
152          column 2
154                                       2           3   4
155     0.0113508 - 0.168281z + 0.8067352z - 1.536926z + z
157                                       2           3   4
158     0.0113508 - 0.168281z + 0.8067352z - 1.536926z + z
160      2
161     z
163     1
164 //display of polynomials
165 z=poly(0,'z')
166  z  =
168     z
169 n=1+z;d=n*n;n1=[n d];d1=[d d*d];n1=[n1 n1];d1=[d1 d1];
170 n2=[n n*n;n*n n**4];d2=[n*n n**4;n n*n];den=d2(1,:);num=n2(2,:);
171 p=poly(rand(5,1),'z');q=poly(rand(6,1),'z');
172 p1=[p,0.1+2.35*z-5.05*z**3];q1=[q,2.56+0.03*z-10.01*z*z+z**5];
173 d3=[1+z**10 z**15];
174 //display of rationals
175 r=num./den
176  r  =
178     1     1
179     -     -
180     1     1
181 r'
182  ans  =
184     1
185     -
186     1
188     1
189     -
190     1
191 rlist(d,n)
192  ans  =
194               2
195     1 + 2z + z
196     ----------
197       1 + z
198 rlist(n,d)
199  ans  =
201       1 + z
202     ---------
203               2
204     1 + 2z + z
205 rlist(d2,n2)
206  ans  =
208               2               2    3   4
209     1 + 2z + z     1 + 4z + 6z + 4z + z
210     ----------     --------------------
211                                   2
212       1 + z             1 + 2z + z
214                                   2
215       1 + z             1 + 2z + z
216     ---------      --------------------
217               2               2    3   4
218     1 + 2z + z     1 + 4z + 6z + 4z + z
219 rlist(n2,d2)
220  ans  =
222                                   2
223       1 + z             1 + 2z + z
224     ---------      --------------------
225               2               2    3   4
226     1 + 2z + z     1 + 4z + 6z + 4z + z
228               2               2    3   4
229     1 + 2z + z     1 + 4z + 6z + 4z + z
230     ----------     --------------------
231                                   2
232       1 + z             1 + 2z + z
233 rlist(den,num)
234  ans  =
236               2               2    3   4
237     1 + 2z + z     1 + 4z + 6z + 4z + z
238     ----------     --------------------
239               2               2    3   4
240     1 + 2z + z     1 + 4z + 6z + 4z + z
241 rlist(num,den)
242  ans  =
244               2               2    3   4
245     1 + 2z + z     1 + 4z + 6z + 4z + z
246     ----------     --------------------
247               2               2    3   4
248     1 + 2z + z     1 + 4z + 6z + 4z + z
249 rlist(p1,q1)
250  ans  =
253          column 1
255                                        2            3            4
256   - 0.0000078 + 0.0351988z - 0.3720034z + 1.3432153z - 1.9632981z
257           5
258        + z
259     ------------------------------------------------------------------
260                                        2            3            4
261     0.0123314 - 0.2684985z + 1.5393672z - 4.0114366z + 5.4004179z
262                    5   6
263        - 3.6713072z + z
265          column 2
267                           3
268        0.1 + 2.35z - 5.05z
269     -------------------------
270                          2   5
271     2.56 + 0.03z - 10.01z + z
272 rlist(q1,p1)
273  ans  =
276          column 1
278                                        2            3            4
279     0.0123314 - 0.2684985z + 1.5393672z - 4.0114366z + 5.4004179z
280                    5   6
281        - 3.6713072z + z
282     ------------------------------------------------------------------
283                                        2            3            4
284   - 0.0000078 + 0.0351988z - 0.3720034z + 1.3432153z - 1.9632981z
285           5
286        + z
288          column 2
290                          2   5
291     2.56 + 0.03z - 10.01z + z
292     -------------------------
293                           3
294        0.1 + 2.35z - 5.05z
295 rlist(p,q)
296  ans  =
298                                        2            3            4
299   - 0.0000078 + 0.0351988z - 0.3720034z + 1.3432153z - 1.9632981z
300           5
301        + z
302     ------------------------------------------------------------------
303                                        2            3            4
304     0.0123314 - 0.2684985z + 1.5393672z - 4.0114366z + 5.4004179z
305                    5   6
306        - 3.6713072z + z
307 rlist(q,p)
308  ans  =
310                                        2            3            4
311     0.0123314 - 0.2684985z + 1.5393672z - 4.0114366z + 5.4004179z
312                    5   6
313        - 3.6713072z + z
314     ------------------------------------------------------------------
315                                        2            3            4
316   - 0.0000078 + 0.0351988z - 0.3720034z + 1.3432153z - 1.9632981z
317           5
318        + z
319 rlist(p,z)
320  ans  =
322                                        2            3            4
323   - 0.0000078 + 0.0351988z - 0.3720034z + 1.3432153z - 1.9632981z
324           5
325        + z
326     ------------------------------------------------------------------
327                                     z
328 rlist(z,p)
329  ans  =
331                                     z
332     -----------------------------------------------------------------
333                                        2            3            4
334   - 0.0000078 + 0.0351988z - 0.3720034z + 1.3432153z - 1.9632981z
335           5
336        + z
337 rlist(d1,n1)
338  ans  =
341          column 1 to 3
343               2               2    3   4              2
344     1 + 2z + z     1 + 4z + 6z + 4z + z     1 + 2z + z
345     ----------     --------------------     ----------
346                                   2
347       1 + z             1 + 2z + z            1 + z
349          column 4
351                2    3   4
352     1 + 4z + 6z + 4z + z
353     --------------------
354                    2
355          1 + 2z + z
356 rlist(n1,d1)
357  ans  =
360          column 1 to 3
362                                   2
363       1 + z             1 + 2z + z            1 + z
364     ---------      --------------------     ---------
365               2               2    3   4              2
366     1 + 2z + z     1 + 4z + 6z + 4z + z     1 + 2z + z
368          column 4
370                    2
371          1 + 2z + z
372     --------------------
373                2    3   4
374     1 + 4z + 6z + 4z + z
375 //display of strings
376 digits='abcdefghijklmnopqrstuvwxyz'
377  digits  =
379  abcdefghijklmnopqrstuvwxyz
380 numbers='1234567890'
381  numbers  =
383  1234567890
384 majuscules='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
385  majuscules  =
387  ABCDEFGHIJKLMNOPQRSTUVWXYZ
388 symbols=',./;''[] \ =-!\\$%^&*()_+~:""[]| @'
389  symbols  =
391  ,./;'[] \ =-!\\$%^&*()_+~:"[]| @
392 [numbers;digits]
393  ans  =
395 !1234567890                  !
396 !                            !
397 !abcdefghijklmnopqrstuvwxyz  !
398 [numbers digits;digits numbers]
399  ans  =
401 !1234567890                  abcdefghijklmnopqrstuvwxyz  !
402 !                                                        !
403 !abcdefghijklmnopqrstuvwxyz  1234567890                  !
404 [numbers digits+digits+digits]
405  ans  =
408          column 1
410 !1234567890  !
412          column 2
414 !abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr!
415 !     stuvwxyz                                                         !
416 ans';
417 [ans ans]
418  ans  =
421          column 1
423 !1234567890                                                            !
424 !                                                                      !
425 !abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr!
426 !     stuvwxyz                                                         !
428          column 2
430 !1234567890                                                            !
431 !                                                                      !
432 !abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr!
433 !     stuvwxyz                                                         !
434 ''
435  ans  =
438 // display of list
439 list()
440  ans  =
442      ()
443 list(1,2,3)
444  ans  =
447        ans(1)
449     1.
451        ans(2)
453     2.
455        ans(3)
457     3.
458 list(list(1,list()),2)
459  ans  =
462        ans(1)
465         ans(1)(1)
467     1.
469         ans(1)(2)
471      ()
473        ans(2)
475     2.
476 list(rlist(q,p),1.23)
477  ans  =
480        ans(1)
482                                        2            3            4
483     0.0123314 - 0.2684985z + 1.5393672z - 4.0114366z + 5.4004179z
484                    5   6
485        - 3.6713072z + z
486     ------------------------------------------------------------------
487                                        2            3            4
488   - 0.0000078 + 0.0351988z - 0.3720034z + 1.3432153z - 1.9632981z
489           5
490        + z
492        ans(2)
494     1.23
496 1:\$
497  ans  =
500  1:1:\$
501 list(1,1:\$)
502  ans  =
505        ans(1)
507     1.
509        ans(2)
512  1:1:\$
513 list(list(1:\$))
514  ans  =
517        ans(1)
520         ans(1)(1)
523  1:1:\$
524 list(list(1,\$),list())
525  ans  =
528        ans(1)
531         ans(1)(1)
533     1.
535         ans(1)(2)
537     \$
539        ans(2)
541      ()
543 TL=tlist('x',1,2)
544  TL  =
547        TL(1)
549  x
551        TL(2)
553     1.
555        TL(3)
557     2.
558 deff('%x_p(x)','disp(x(3),x(2),''Mydisplay'')')
559 TL
560  TL  =
563  Mydisplay
565     1.
567     2.
568 list(TL)
569  ans  =
572        ans(1)
575  Mydisplay
577     1.
579     2.
580 list(list(TL))
581  ans  =
584        ans(1)
587         ans(1)(1)
590  Mydisplay
592     1.
594     2.
595 TL=tlist('x',1:\$,2)
596  TL  =
599  Mydisplay
602  1:1:\$
604     2.
605 list(TL)
606  ans  =
609        ans(1)
612  Mydisplay
615  1:1:\$
617     2.
618 list(list(TL))
619  ans  =
622        ans(1)
625         ans(1)(1)
628  Mydisplay
631  1:1:\$
633     2.
634 TL(2)=TL
635  TL  =
638  Mydisplay
641  Mydisplay
644  1:1:\$
646     2.
648     2.