Hp 48/49 List - Hewlett Packard

This is a discussion on Hp 48/49 List - Hewlett Packard ; Two questions. 1- How I make to create a matrix from two lists and a number? Stack 3: {1,45 2,1 0,5 ...} 2: {105 130 50 ....} 1: 285 2- How to check if a list is pair? I need ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: Hp 48/49 List

  1. Hp 48/49 List

    Two questions.
    1- How I make to create a matrix from two lists and a number?
    Stack
    3: {1,45 2,1 0,5 ...}
    2: {105 130 50 ....}
    1: 285

    2- How to check if a list is pair? I need that it is pair {1 3 4 6}.
    If the list will be odd {2 4 7} the program informs to me that they
    lack arguments.

    Thank you!

  2. Re: Hp 48/49 List

    On Mar 8, 7:47 pm, fra...@uol.com.br wrote:
    > Two questions.
    > 1- How I make to create a matrix from two lists and a number?
    > Stack
    > 3: {1,45 2,1 0,5 ...}
    > 2: {105 130 50 ....}
    > 1: 285
    >
    > 2- How to check if a list is pair? I need that it is pair {1 3 4 6}.
    > If the list will be odd {2 4 7} the program informs to me that they
    > lack arguments.
    >
    > Thank you!


    and I wish to know how to make gold out of iron
    thank you!

  3. Re: Hp 48/49 List

    On Mar 8, 3:47*am, fra...@uol.com.br wrote:
    > Two questions.
    > 1- How I make to create a matrix from two lists and a number?
    > Stack
    > 3: * {1,45 2,1 0,5 ...}
    > 2: * {105 130 50 ....}
    > 1: * 285
    >
    > 2- How to check if a list is pair? I need that it is pair {1 3 4 6}.
    > If the list will be odd {2 4 7} the program informs to me that they
    > lack arguments.
    >
    > Thank you!


    Could you provide more detail? I do not understand either of your
    questions.
    Regards,
    TomCee

  4. Re: Hp 48/49 List

    On 8 mar, 13:41, tomcee wrote:
    > On Mar 8, 3:47 am, fra...@uol.com.br wrote:
    >
    > > Two questions.
    > > 1- How I make to create a matrix from two lists and a number?
    > > Stack
    > > 3: {1,45 2,1 0,5 ...}
    > > 2: {105 130 50 ....}
    > > 1: 285

    >
    > > 2- How to check if a list is pair? I need that it is pair {1 3 4 6}.
    > > If the list will be odd {2 4 7} the program informs to me that they
    > > lack arguments.

    >
    > > Thank you!

    >
    > Could you provide more detail? I do not understand either of your
    > questions.
    > Regards,
    > TomCee


    1- On my Stack:
    Stack
    Input
    Output In Matrix format.
    3: {1,45 2,1 0,5 ...} << a program to convert >>
    1,45 2,1 0,5 ...
    2: {105 130
    50 ....}
    105 130 50 ...
    1:
    285
    285

    2- I has a list on my stack. {1 3 2 3 7 9....}
    I would like to check if a list is pair. I want to say. it has 2 or 4
    or 6 or 8....numbers, { 1 2} or {1 2 3 4} or {1 2 3 4 5 6}. It's ok.
    If it had 1 or 3 or 5...{1} or {2 4 1} or {1 6 8 2 1}...That I am
    informed of this..

    Sorry.
    My english it's poor.

    Thank you so much.


  5. Re: Hp 48/49 List

    On 8 mar, 13:41, tomcee wrote:
    > On Mar 8, 3:47 am, fra...@uol.com.br wrote:
    >
    > > Two questions.
    > > 1- How I make to create a matrix from two lists and a number?
    > > Stack
    > > 3: {1,45 2,1 0,5 ...}
    > > 2: {105 130 50 ....}
    > > 1: 285

    >
    > > 2- How to check if a list is pair? I need that it is pair {1 3 4 6}.
    > > If the list will be odd {2 4 7} the program informs to me that they
    > > lack arguments.

    >
    > > Thank you!

    >
    > Could you provide more detail? I do not understand either of your
    > questions.
    > Regards,
    > TomCee


    1- On my Stack:
    Stack
    Input

    3: {1,45 2,1 0,5 ...}
    2: {105 130 50 ....}
    1: 285

    << a program to convert >>

    Output. In Matrix format.
    1,45 2,1 0,5 ...
    105 130 50 ...
    285

    2- I has a list on my stack. {1 3 2 3 7 9....}
    I would like to check if a list is pair. I want to say. it has 2 or 4
    or 6 or 8....numbers, { 1 2} or {1 2 3 4} or {1 2 3 4 5 6}. It's ok.
    If the list had 1 or 3 or 5...{1} or {2 4 1} or {1 6 8 2 1}...That I
    am
    informed of this..

    Sorry.
    My english it's poor.

    Thank you so much.

  6. Re: Hp 48/49 List

    On Mar 8, 1:18 pm, fra...@uol.com.br wrote:
    > On 8 mar, 13:41, tomcee wrote:
    >
    >
    >
    > > On Mar 8, 3:47 am, fra...@uol.com.br wrote:

    >
    > > > Two questions.
    > > > 1- How I make to create a matrix from two lists and a number?
    > > > Stack
    > > > 3: {1,45 2,1 0,5 ...}
    > > > 2: {105 130 50 ....}
    > > > 1: 285

    >
    > > > 2- How to check if a list is pair? I need that it is pair {1 3 4 6}.
    > > > If the list will be odd {2 4 7} the program informs to me that they
    > > > lack arguments.

    >
    > > > Thank you!

    >
    > > Could you provide more detail? I do not understand either of your
    > > questions.
    > > Regards,
    > > TomCee

    >
    > 1- On my Stack:
    > Stack
    > Input
    >
    > 3: {1,45 2,1 0,5 ...}
    > 2: {105 130 50 ....}
    > 1: 285
    >
    > << a program to convert >>
    >
    > Output. In Matrix format.
    > 1,45 2,1 0,5 ...
    > 105 130 50 ...
    > 285


    Unless I am completely in the dark about something I believe that each
    row and each column in a matrix must be of the same dimension, ie you
    cannot have 2 rows with 3 or more numbers and then the third row with
    only one number, so you could fill the remainder of the row with
    zeros. Having said that and assuming your arguments in stack level 3
    and 2 are also the same dimension you could try the following:

    << OVER SIZE 1 - 0 SWAP NDUPN 1 + ->LIST AXL ROT AXL 1 ROW-> ROT AXL 2
    ROW+ SWAP 3 ROW+ >>
    this will create:
    [ [ 1.45 2.1 0.5 ]
    [ 105. 130. 50. ]
    [ 285. 0. 0. ] ]
    Most likely there's a more elegant way of doing this but it gets the
    job done.



    >
    > 2- I has a list on my stack. {1 3 2 3 7 9....}
    > I would like to check if a list is pair. I want to say. it has 2 or 4
    > or 6 or 8....numbers, { 1 2} or {1 2 3 4} or {1 2 3 4 5 6}. It's ok.
    > If the list had 1 or 3 or 5...{1} or {2 4 1} or {1 6 8 2 1}...That I
    > am
    > informed of this..


    Try the following:

    << DUP SIZE 2 / FP IF 0 =/ THEN "WHAT AN ODD LIST" MSGBOX END >>

    Note: the =/ is supposed to signify the "not equal" symbol


    >
    > Sorry.
    > My english it's poor.
    >
    > Thank you so much.


    I hope this was what you were trying to accomplish.

    Jacob


  7. Re: Hp 48/49 List

    On 8 mar, 21:28, Jacob Wall wrote:
    > On Mar 8, 1:18 pm, fra...@uol.com.br wrote:
    >
    >
    >
    > > On 8 mar, 13:41, tomcee wrote:

    >
    > > > On Mar 8, 3:47 am, fra...@uol.com.br wrote:

    >
    > > > > Two questions.
    > > > > 1- How I make to create a matrix from two lists and a number?
    > > > > Stack
    > > > > 3: {1,45 2,1 0,5 ...}
    > > > > 2: {105 130 50 ....}
    > > > > 1: 285

    >
    > > > > 2- How to check if a list is pair? I need that it is pair {1 3 4 6}.
    > > > > If the list will be odd {2 4 7} the program informs to me that they
    > > > > lack arguments.

    >
    > > > > Thank you!

    >
    > > > Could you provide more detail? I do not understand either of your
    > > > questions.
    > > > Regards,
    > > > TomCee

    >
    > > 1- On my Stack:
    > > Stack
    > > Input

    >
    > > 3: {1,45 2,1 0,5 ...}
    > > 2: {105 130 50 ....}
    > > 1: 285

    >
    > > << a program to convert >>

    >
    > > Output. In Matrix format.
    > > 1,45 2,1 0,5 ...
    > > 105 130 50 ...
    > > 285

    >
    > Unless I am completely in the dark about something I believe that each
    > row and each column in a matrix must be of the same dimension, ie you
    > cannot have 2 rows with 3 or more numbers and then the third row with
    > only one number, so you could fill the remainder of the row with
    > zeros. Having said that and assuming your arguments in stack level 3
    > and 2 are also the same dimension you could try the following:
    >
    > << OVER SIZE 1 - 0 SWAP NDUPN 1 + ->LIST AXL ROT AXL 1 ROW-> ROT AXL 2
    > ROW+ SWAP 3 ROW+ >>
    > this will create:
    > [ [ 1.45 2.1 0.5 ]
    > [ 105. 130. 50. ]
    > [ 285. 0. 0. ] ]
    > Most likely there's a more elegant way of doing this but it gets the
    > job done.
    >
    >
    >
    > > 2- I has a list on my stack. {1 3 2 3 7 9....}
    > > I would like to check if a list is pair. I want to say. it has 2 or 4
    > > or 6 or 8....numbers, { 1 2} or {1 2 3 4} or {1 2 3 4 5 6}. It's ok.
    > > If the list had 1 or 3 or 5...{1} or {2 4 1} or {1 6 8 2 1}...That I
    > > am
    > > informed of this..

    >
    > Try the following:
    >
    > << DUP SIZE 2 / FP IF 0 =/ THEN "WHAT AN ODD LIST" MSGBOX END >>
    >
    > Note: the =/ is supposed to signify the "not equal" symbol
    >
    >
    >
    > > Sorry.
    > > My english it's poor.

    >
    > > Thank you so much.

    >
    > I hope this was what you were trying to accomplish.
    >
    > Jacob


    << DUP SIZE 2 / FP IF 0 =/ THEN "WHAT AN ODD LIST" MSGBOX END >>
    Nice! This worked well.

    << OVER SIZE 1 - 0 SWAP NDUPN 1 + ->LIST AXL ROT AXL 1 ROW-> ROT AXL 2
    > ROW+ SWAP 3 ROW+ >>

    Good! This worked well too.

    Initially, i had a problem. I use Hp48. It does not have this command
    (NDUPN; AXL). I tried this to create the function NDUPN; AXL
    http://groups.google.com/group/comp....66a46c7ad0ad34

    Now, it is all good.
    Thank you so much.

  8. Re: Hp 48/49 List

    On 8 mar, 21:28, Jacob Wall wrote:
    > On Mar 8, 1:18 pm, fra...@uol.com.br wrote:
    >
    >
    >
    > > On 8 mar, 13:41, tomcee wrote:

    >
    > > > On Mar 8, 3:47 am, fra...@uol.com.br wrote:

    >
    > > > > Two questions.
    > > > > 1- How I make to create a matrix from two lists and a number?
    > > > > Stack
    > > > > 3: {1,45 2,1 0,5 ...}
    > > > > 2: {105 130 50 ....}
    > > > > 1: 285

    >
    > > > > 2- How to check if a list is pair? I need that it is pair {1 3 4 6}.
    > > > > If the list will be odd {2 4 7} the program informs to me that they
    > > > > lack arguments.

    >
    > > > > Thank you!

    >
    > > > Could you provide more detail? I do not understand either of your
    > > > questions.
    > > > Regards,
    > > > TomCee

    >
    > > 1- On my Stack:
    > > Stack
    > > Input

    >
    > > 3: {1,45 2,1 0,5 ...}
    > > 2: {105 130 50 ....}
    > > 1: 285

    >
    > > << a program to convert >>

    >
    > > Output. In Matrix format.
    > > 1,45 2,1 0,5 ...
    > > 105 130 50 ...
    > > 285

    >
    > Unless I am completely in the dark about something I believe that each
    > row and each column in a matrix must be of the same dimension, ie you
    > cannot have 2 rows with 3 or more numbers and then the third row with
    > only one number, so you could fill the remainder of the row with
    > zeros. Having said that and assuming your arguments in stack level 3
    > and 2 are also the same dimension you could try the following:
    >
    > << OVER SIZE 1 - 0 SWAP NDUPN 1 + ->LIST AXL ROT AXL 1 ROW-> ROT AXL 2
    > ROW+ SWAP 3 ROW+ >>
    > this will create:
    > [ [ 1.45 2.1 0.5 ]
    > [ 105. 130. 50. ]
    > [ 285. 0. 0. ] ]
    > Most likely there's a more elegant way of doing this but it gets the
    > job done.
    >
    >
    >
    > > 2- I has a list on my stack. {1 3 2 3 7 9....}
    > > I would like to check if a list is pair. I want to say. it has 2 or 4
    > > or 6 or 8....numbers, { 1 2} or {1 2 3 4} or {1 2 3 4 5 6}. It's ok.
    > > If the list had 1 or 3 or 5...{1} or {2 4 1} or {1 6 8 2 1}...That I
    > > am
    > > informed of this..

    >
    > Try the following:
    >
    > << DUP SIZE 2 / FP IF 0 =/ THEN "WHAT AN ODD LIST" MSGBOX END >>
    >
    > Note: the =/ is supposed to signify the "not equal" symbol
    >
    >
    >
    > > Sorry.
    > > My english it's poor.

    >
    > > Thank you so much.

    >
    > I hope this was what you were trying to accomplish.
    >
    > Jacob


    Only more a point. Is possible a Matrix of 3 columns instead of 3
    lines? This would facilitate the visualization!

    Thanks..

  9. Re: Hp 48/49 List

    On 8 mar, 21:28, Jacob Wall wrote:
    > On Mar 8, 1:18 pm, fra...@uol.com.br wrote:
    >
    >
    >
    > > On 8 mar, 13:41, tomcee wrote:

    >
    > > > On Mar 8, 3:47 am, fra...@uol.com.br wrote:

    >
    > > > > Two questions.
    > > > > 1- How I make to create a matrix from two lists and a number?
    > > > > Stack
    > > > > 3: {1,45 2,1 0,5 ...}
    > > > > 2: {105 130 50 ....}
    > > > > 1: 285

    >
    > > > > 2- How to check if a list is pair? I need that it is pair {1 3 4 6}.
    > > > > If the list will be odd {2 4 7} the program informs to me that they
    > > > > lack arguments.

    >
    > > > > Thank you!

    >
    > > > Could you provide more detail? I do not understand either of your
    > > > questions.
    > > > Regards,
    > > > TomCee

    >
    > > 1- On my Stack:
    > > Stack
    > > Input

    >
    > > 3: {1,45 2,1 0,5 ...}
    > > 2: {105 130 50 ....}
    > > 1: 285

    >
    > > << a program to convert >>

    >
    > > Output. In Matrix format.
    > > 1,45 2,1 0,5 ...
    > > 105 130 50 ...
    > > 285

    >
    > Unless I am completely in the dark about something I believe that each
    > row and each column in a matrix must be of the same dimension, ie you
    > cannot have 2 rows with 3 or more numbers and then the third row with
    > only one number, so you could fill the remainder of the row with
    > zeros. Having said that and assuming your arguments in stack level 3
    > and 2 are also the same dimension you could try the following:
    >
    > << OVER SIZE 1 - 0 SWAP NDUPN 1 + ->LIST AXL ROT AXL 1 ROW-> ROT AXL 2
    > ROW+ SWAP 3 ROW+ >>
    > this will create:
    > [ [ 1.45 2.1 0.5 ]
    > [ 105. 130. 50. ]
    > [ 285. 0. 0. ] ]
    > Most likely there's a more elegant way of doing this but it gets the
    > job done.
    >
    >
    >
    > > 2- I has a list on my stack. {1 3 2 3 7 9....}
    > > I would like to check if a list is pair. I want to say. it has 2 or 4
    > > or 6 or 8....numbers, { 1 2} or {1 2 3 4} or {1 2 3 4 5 6}. It's ok.
    > > If the list had 1 or 3 or 5...{1} or {2 4 1} or {1 6 8 2 1}...That I
    > > am
    > > informed of this..

    >
    > Try the following:
    >
    > << DUP SIZE 2 / FP IF 0 =/ THEN "WHAT AN ODD LIST" MSGBOX END >>
    >
    > Note: the =/ is supposed to signify the "not equal" symbol
    >
    >
    >
    > > Sorry.
    > > My english it's poor.

    >
    > > Thank you so much.

    >
    > I hope this was what you were trying to accomplish.
    >
    > Jacob


    Only more a point. Is possible a Matrix of 3 columns instead of 3
    row? This would facilitate the visualization!

    Thanks..

  10. Re: Hp 48/49 List

    On Mar 9, 10:10 am, fra...@uol.com.br wrote:
    > On 8 mar, 21:28, Jacob Wall wrote:
    >
    >
    >
    > > On Mar 8, 1:18 pm, fra...@uol.com.br wrote:

    >
    > > > On 8 mar, 13:41, tomcee wrote:

    >
    > > > > On Mar 8, 3:47 am, fra...@uol.com.br wrote:

    >
    > > > > > Two questions.
    > > > > > 1- How I make to create a matrix from two lists and a number?
    > > > > > Stack
    > > > > > 3: {1,45 2,1 0,5 ...}
    > > > > > 2: {105 130 50 ....}
    > > > > > 1: 285

    >
    > > > > > 2- How to check if a list is pair? I need that it is pair {1 3 4 6}.
    > > > > > If the list will be odd {2 4 7} the program informs to me that they
    > > > > > lack arguments.

    >
    > > > > > Thank you!

    >
    > > > > Could you provide more detail? I do not understand either of your
    > > > > questions.
    > > > > Regards,
    > > > > TomCee

    >
    > > > 1- On my Stack:
    > > > Stack
    > > > Input

    >
    > > > 3: {1,45 2,1 0,5 ...}
    > > > 2: {105 130 50 ....}
    > > > 1: 285

    >
    > > > << a program to convert >>

    >
    > > > Output. In Matrix format.
    > > > 1,45 2,1 0,5 ...
    > > > 105 130 50 ...
    > > > 285

    >
    > > Unless I am completely in the dark about something I believe that each
    > > row and each column in a matrix must be of the same dimension, ie you
    > > cannot have 2 rows with 3 or more numbers and then the third row with
    > > only one number, so you could fill the remainder of the row with
    > > zeros. Having said that and assuming your arguments in stack level 3
    > > and 2 are also the same dimension you could try the following:

    >
    > > << OVER SIZE 1 - 0 SWAP NDUPN 1 + ->LIST AXL ROT AXL 1 ROW-> ROT AXL 2
    > > ROW+ SWAP 3 ROW+ >>
    > > this will create:
    > > [ [ 1.45 2.1 0.5 ]
    > > [ 105. 130. 50. ]
    > > [ 285. 0. 0. ] ]
    > > Most likely there's a more elegant way of doing this but it gets the
    > > job done.

    >
    > > > 2- I has a list on my stack. {1 3 2 3 7 9....}
    > > > I would like to check if a list is pair. I want to say. it has 2 or 4
    > > > or 6 or 8....numbers, { 1 2} or {1 2 3 4} or {1 2 3 4 5 6}. It's ok.
    > > > If the list had 1 or 3 or 5...{1} or {2 4 1} or {1 6 8 2 1}...That I
    > > > am
    > > > informed of this..

    >
    > > Try the following:

    >
    > > << DUP SIZE 2 / FP IF 0 =/ THEN "WHAT AN ODD LIST" MSGBOX END >>

    >
    > > Note: the =/ is supposed to signify the "not equal" symbol

    >
    > > > Sorry.
    > > > My english it's poor.

    >
    > > > Thank you so much.

    >
    > > I hope this was what you were trying to accomplish.

    >
    > > Jacob

    >
    > Only more a point. Is possible a Matrix of 3 columns instead of 3
    > row? This would facilitate the visualization!
    >
    > Thanks..


    Sure, just replace every instance of ROW with COL
    << OVER SIZE 1 - 0 SWAP NDUPN 1 + ->LIST AXL ROT AXL 1 COL-> ROT AXL 2
    COL+ SWAP 3 COL+ >>

+ Reply to Thread