Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Hi, wondering if someone can help me out with this one please?
Mathcad Prime 7
I have a vector [A], which could have any number of rows, each element can be either zero or one, and the origin element is always one.
I have another vector [B], which has the same number of rows as [A], and contains data (forces).
I would like to create another vector [C], where each element in [C] should equal the corresponding element in [B] if the corresponding element in [A] equals one. If an element in [A] equals zero then that value in [B] gets added to the last element in [C] that related to a one in [A]. That continues until another one appears in [A], and it starts again. Elements in [C] that correspond with zero elements in [A] should equal zero.
For example:
Thanks
Solved! Go to Solution.
I guess this function should do the trick
P6 file attached
Fantastic! Thank you.