EXECON HELP (DoLIST ~= HP50 CMD)
09-03-2016, 07:37 PM (This post was last modified: 09-04-2016 01:41 AM by compsystems.)
Post: #1
 compsystems Senior Member Posts: 1,201 Joined: Dec 2013
EXECON HELP (DoLIST ~= HP50 CMD)
EXECON("&1+10",{1,2,3}) -> {11,12,13} // == {1,2,3} .+ 10 // Ok SEQUENCE, do each element of the list + 1

EXECON("&1-&2",{1,4,3,5}) -> {-3,1,-2} // Ok
EXECON("&2-&1",{1,4,3,5}) -> {3,-1,2} // == {4-1, 3-4, 5-3} Ok SEQUENCE, do form element 2 - previous element

EXECON("&2-&1",{1,2,3}, {4,5,6}) -> {3,3,3} // Ok SEQUENCE, do element 1 of list2 - element 1 of list1
EXECON("&1-&2",{1,2,3}, {4,5,6}) -> {-3,-3,-3} // Ok SEQUENCE, do element 1 of list1 - element 1 of list2

EXECON("(&1)*5",{1,2,3}) Returns {5,10, 15} // Ok
EXECON("&11 *5",{1,2,3}) Returns {5,10, 15} 11 How this is interpreted?
EXECON("&2 *5",{1,2,3}) Returns {10, 15} // Ok ({1,2,3}[2, ...]) .* 5 -> {2,3}*5 -> {10, 15}
EXECON("&12 *5",{1,2,3}) Returns {10, 15} // Ok
EXECON("&3 *5",{1,2,3}) Returns {15} // Ok
EXECON("&4 *5",{1,2,3}) "Error: Invalid input" // Ok

EXECON("&1 *5",[1,2,3]) Returns [5,10, 15] // Ok each element of the list * 5
EXECON("&2 *5",[1,2,3]) Returns [10] // ????????
EXECON("&12 *5",[1,2,3]) Returns [10] // ???????? -> [10, 15]
why with bracketed [] return a different answer ????????

EXECON("&1+&2",{1,2,3}, {4,5,6}) -> {5,7,9}

EXECON("&1+&2",{{1,2,3}, {4,5,6}}) -> {{5,7,9}}

EXECON("&2 *5",{{1,2,3}, {4,5,6}}) returns {{20,25,30}} // {{1,2,3},{4,5,6}}[2, ...] -> {4,5,6} Ok element(2,...)
EXECON("&12 *5",{{1,2,3}, {4,5,6}}) returns {{20,25,30}} 12 How this is interpreted?

EXECON("&1 *5",{{1,2,3}, {4,5,6}}) -> {{5,10,15}, {20,25,30}} // {{1,2,3},{4,5,6}}[1, ...] -> {{1,2,3},{4,5,6}}

EXECON("&1 =0",{1,2}) -> {0,0} ??? -> {1=0, 2=0}

EXECON("&1+10",{a,b,c}) -> "Error: Syntax Error" =(, cmd CAS equivalent?
09-03-2016, 08:29 PM
Post: #2
 Didier Lachieze Senior Member Posts: 1,151 Joined: Dec 2013
RE: EXECON HELP
(09-03-2016 07:37 PM)compsystems Wrote:  EXECON("&1+10",{a,b,c}) -> "Error: Syntax Error" =(, cmd CAS equivalent?

{a,b,c}+10 -> {a+10, b+10, c+10}
09-03-2016, 08:39 PM
Post: #3
 compsystems Senior Member Posts: 1,201 Joined: Dec 2013
RE: EXECON HELP (DoLIST ~= HP50 CMD)
but an equivalent cmd to general symbolic expressions "functions"

EXECON("&1-&2",{a,b,c,d}) -> {a-b, b-c, c-d}
09-03-2016, 09:32 PM (This post was last modified: 09-03-2016 09:33 PM by Didier Lachieze.)
Post: #4
 Didier Lachieze Senior Member Posts: 1,151 Joined: Dec 2013
RE: EXECON HELP (DoLIST ~= HP50 CMD)
I don't think there is a CAS command similar to EXECON.
So no general function, each case needs to be coded specifically.

you can do in CAS: revlist(tail(revlist({a,b,c,d}-tail({a,b,c,d}))))
09-04-2016, 01:36 AM (This post was last modified: 09-04-2016 02:03 AM by compsystems.)
Post: #5
 compsystems Senior Member Posts: 1,201 Joined: Dec 2013
RE: EXECON HELP (DoLIST ~= HP50 CMD)
another example with numeric and symbolic elements =(

hp-prime
execon("(&2+&3)*&1",{1,2,3}, {4,5,6}, {7,8,9}) -> {11,26,45}
previous is same ({4,5,6} .+ {7,8,9}) .* {1,2,3} -> {11,26,45}

execon("(&2+&3)*&1",{a,b,c}, {d,e1,f}, {g,h,i1}) -> "Error: Syntax Error" =(

EXECON("(&1)=0",{1,2}) -> {0,0} BUG? , ok -> {1=0, 2=0}

hp48sx/gx - hp49g/49g+ - hp50g RPN

{1,2,3} {4,5,6} {7,8,9} 3 « + * » DOLIST -> {11,26,45}
{a,b,c} {d,e1,f} {g,h,i1} 3 « + * » DOLIST -> { 'a*(d+g)' 'b*(e1+h)' 'c*(f+i1)' } =)

{1,2} 1 « 0 = » DOLIST - > { '1=0' '2=0' }
09-04-2016, 01:53 AM (This post was last modified: 11-13-2016 01:36 PM by compsystems.)
Post: #6
 compsystems Senior Member Posts: 1,201 Joined: Dec 2013
RE: EXECON HELP (DoLIST ~= HP50 CMD)
testing Matrix Applied Program/function, MAP CMD

map({{1,2,3}, {4,5,6}, {7,8,9}}, x -> x+1 ) [enter] returns [{2,3,4},{5,6,7},{8,9,10}]

map({{1,2,3}, {4,5,6}, {7,8,9}}, (x,y,z) -> (y+z)*x) ) [enter] returns "Error" Why?
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)