Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Hello.
I had a question.
I want to make "C" by plusing A and B
It means that "B" from 2 rows(5) should add under 4 rows in "A" automatically.
Could you help me?
C:=stack(A,B)
Thank you for helping.
But I want to get result's values without duplication.
I got same value "4"
jinsuk Lee wrote:
Thank you for helping.
But I want to get result's values without duplication.
And sorted, too?
There will be no specific command in Mathcad to do so and it will require a samll program. You will have to specify your needs in more detail. As it looks to me now its not a matter of combining two vectors but rather a problem of removing duplicates from a single vector. I think you will have to provide more different examples to make it clear.
E.g. what about A=(3,6,3,2) B=(7,1,7,3) What result do you expect? C=(1,2,3,6,7) or C=(3,6,2,7,1) or what else?
Unfortunately, I'm Mathcadless at the moment, but if you look in the worksheet I've attached to this message http://communities.ptc.com/message/266834#266834 I hope you will find the functions set and setcount in the collapsed Utilities Area. set (stack (A, B)) should do the trick. set sorts, though ... I do have a version that doesn't sort somewhere that checks if an element is in the 'set' vector (initialized to the first element of the input vector) and adds the element of it isn't., but I don't know where it is.
Stuart
Thank you.
I settle finally to use "submatrix"
so you don't need to think about my question anymore.
Thank you for consideration.
thank you for consideration.