MuPAD Pro Computing Essentials, 2nd Edition

Example 5.4 To produce a long list of numbers

 
elist := proc(n1: Type::Integer, n2:Type::Integer)
   local mylist, n;
begin
   mylist := [ float((1+1/n)^n) $ n=n1..n2 ];
   return(mylist)
end:
list1to5:=elist(1,5);
 
[2.0, 2.25, 2.37037037, 2.44140625, 2.48832]

 

 

© Miroslaw Majewski, Abu Dhabi,  Update  26-10-2004