Sponsored links: Algebra eBooks
 

Related

make_array

Run Example
(%i1)arraymake (a, [1]);
(%o1)                                 a
                                       1
(%i2)  arraymake (a, [k]);
(%o2)                                 a
                                       k
(%i3)  arraymake (a, [i, j, 3]);
(%o3)                              a
                                    i, j, 3
(%i4)  array (a, fixnum, 10);
(%o4)                                  a
(%i5)  fillarray (a, makelist (i^2, i, 1, 11));
(%o5)                                  a
(%i6)  arraymake (a, [5]);
(%o6)                                 a
                                       5
(%i7)  ''%;
(%o7)             (%i8)  l : [a, b, c, d, e];
(%o8)                           [a, b, c, d, e]
(%i9)  arraymake ('l, [n]);
(%o9)                                 l
                                       n
(%i10)  ''%, n = 3;
(%o10)            (%i11)  a2 : make_array (fixnum, 10);
(%o11)                 {Array:  #(0 0 0 0 0 0 0 0 0 0)}
(%i12)  fillarray (a2, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
(%o12)                 {Array:  #(1 2 3 4 5 6 7 8 9 10)}
(%i13)  arraymake ('a2, [8]);
(%o13)                                a2
                                        8
(%i14)  ''%;
(%o14)            
Run Example
N:1;
(%o1)                                  1
(%i2) a:N*0.1;
(%o2)                                 0.1
(%i3) b:a+0.5;
(%o3)                                 0.6
(%i4) c:(a+b)/2;
(%o4)                                0.35
(%i5) h:0.05;
(%o5)                                0.05
(%i6) n:1+floor((b-a)/h);
(%o6)                                 11
(%i7) x1:make_array(flonum,n);
(%o7)      {Array:  #(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0)}
(%i8) y1:make_array(flonum,n);
(%o8)      {Array:  #(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0)}
(%i9) x1[0]:a;
(%o9)                                 0.1
(%i10) x1[1]:a+h;
(%o10)                               0.15
(%i11) y1[0]:c;
(%o11)                               0.35
(%i12) for i:2 thru n-1 step 1 do (x1[i]:x1[i-1]+h);
(%o12)                               done
(%i13) for i:1 thru n-1 step 1 do (y1[i]:float(y1[i-1]+h*(2*(x1[i-1])^2+x1[i-1]*y1[i-1]+3*(y1[i-1])^2)));
(%o13)                               done
(%i14) wxdraw2d(point_type=circle,    point_size=1,     points_joined=true,     key="Eiler",    color=red,    points(x1,y1));
(%o14) wxdraw2d(point_type = circle, point_size = 1, points_joined = true, 
key = Eiler, color = red, points({Array:  #(0.10000000000000001 0.150000000000\
00002 0.20000000000000001 0.25
  0.29999999999999999 0.34999999999999998 0.39999999999999997
  0.44999999999999996 0.49999999999999994 0.54999999999999993
  0.59999999999999998)}, {Array:  #(0.34999999999999998 0.37112499999999998 0.\
39681850234374999
  0.42840642593753797 0.4675413161294435 0.51634366821459299
  0.57762129996414358 0.65522068088926655 0.75461026730902414
  0.88389102232097927 1.05563752633575)}))
(%i15) 
Run Example
debugmode(true);
(%o1)                                true
(%i2) tekst:"ALA";
(%o2)                                 ALA
(%i3) code:[a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p];
(%o3)          [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p]
(%i4) characters:charlist(tekst);
(%o4)                              [A, L, A]
(%i5) out:make_array(any,slength(tekst));
(%o5)                      {Array:  #(NIL NIL NIL)}
(%i6) for i:1 while i <
= slength(tekst) do( out[i-1]:code[cint(characters[i])-64]);
(%o6)                                done
(%i7) listarray(out);
(%o7)                              [a, l, a]
(%i8) 

Related Help

Help for Make_array