Skip to main content
20-Turquoise
February 26, 2024
Question

trimZeroElements( ) ?

  • February 26, 2024
  • 1 reply
  • 7808 views

Hello Everyone.
From :

1.PNG
Need help with the trimZeroElements( ) program function with ORIGIN := 1 and ORIGIN := 0 ?
Thanks in advance for the time and help.
Best Regards.
Loi.

1 reply

25-Diamond I
February 26, 2024
lvl10720-TurquoiseAuthor
20-Turquoise
February 27, 2024

I appreciate for your answer with .xmcd, mathcad file, Werner. 😊 ( I usually type a wrong key-stroke ! ) and :

1'a.PNG

and of course I would expect is :  

                                                           1''.PNG  !!

2.PNG

3.PNG

   In any case of INPUT and the OUTPUT is as the my question above ( yellow highlight )

       Best Regards.

            Loi.

25-Diamond I
February 27, 2024

Werner_E_1-1708998350045.png

 

Really? The "3" is coming out of thin air. Its not in the input but appears in the output?

I can see no logic here! Why would the numbers be rearranged that way? Why does he "9" appear only once in the result? .....

 

And what would the desired output be here? 25 zeros and 11 non-zero numbers, all different.

Werner_E_2-1708998560558.png

 

You will have to clearly and precisely DESCRIBE what the behaviour of your magic function should be - not just providing one or two examples!

Otherwise I would, from what you posted so far, suggest the following function

Werner_E_4-1708999341558.png