newbie question: how to take element from an array on command line
|
12-27-2017, 05:20 PM
Post: #1
|
|||
|
|||
newbie question: how to take element from an array on command line
say `iquorem(63, 23)` returns [2, 17], how do I get 2, or 17 out of that array[/quote]
|
|||
12-27-2017, 06:10 PM
Post: #2
|
|||
|
|||
RE: newbie question: how to take element from an array on command line
Perhaps with 'iquorem(63,23)[1]' or [2]
Arno |
|||
12-27-2017, 06:38 PM
Post: #3
|
|||
|
|||
RE: newbie question: how to take element from an array on command line
(12-27-2017 06:10 PM)Arno K Wrote: Perhaps with 'iquorem(63,23)[1]' or [2] Using [1] (or [2]) is ok in CAS, however, and in Home it would perform an implicit multiplication... ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
12-27-2017, 07:16 PM
Post: #4
|
|||
|
|||
RE: newbie question: how to take element from an array on command line | |||
12-27-2017, 08:57 PM
Post: #5
|
|||
|
|||
RE: newbie question: how to take element from an array on command line
(12-27-2017 06:38 PM)salvomic Wrote:(12-27-2017 06:10 PM)Arno K Wrote: Perhaps with 'iquorem(63,23)[1]' or [2] I totally forgot about that as I ususally always work in CAS. So here a solution is: L1:=iquorem(63,23); L1(1), recalls the first element of the result, that is 2 Arno |
|||
12-27-2017, 09:05 PM
Post: #6
|
|||
|
|||
RE: newbie question: how to take element from an array on command line
(12-27-2017 08:57 PM)Arno K Wrote: I totally forgot about that as I ususally always work in CAS. So here a solution is: Right... Maybe it is useful a more general way, that would be valid both in CAS and Home, to extract elements from matrices and vectors []. i.e. in Home M1(2,3) is ok but [[1,2,3],[4,5,6],[7,8,9]] [2,3] tries to multiply, instead of extracting elements (in CAS that's ok). ∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib |
|||
12-30-2017, 08:20 PM
Post: #7
|
|||
|
|||
RE: newbie question: how to take element from an array on command line | |||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)