cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.

Delete elements from columne vectors

snã¦ss
5-Regular Member

Delete elements from columne vectors

Hi!
I have written a function i call "STACK(A)" that takes a column vector, and loops through it and stacks all non zero elements in a new column vector. 

 stack.PNG
My problem is the output, the new column vector is displayed as:

result.PNG

Any suggestions on how to get a new normal column vector like the "IntendedOutput"

Regards 😄 
Sigurd 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:snã¦ss)

Simply omit the "stack" command and you get the output you expect!

Find also some less elaborate routines below - their output differs if the input vector consists of zeros only!

B.png

 

View solution in original post

1 REPLY 1
Werner_E
25-Diamond I
(To:snã¦ss)

Simply omit the "stack" command and you get the output you expect!

Find also some less elaborate routines below - their output differs if the input vector consists of zeros only!

B.png

 

Announcements

Top Tags