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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Comparing data from two arrays

ptc-3820221
1-Visitor

Comparing data from two arrays

I am looking for the easiest way to compare the data from two arrays. I have two output arrays, each consisting of one column and several rows and I would like to compare the two to find the max value for each row. The final result should be another array with one column and the same number of rows. I've been trying if/then statements and the 'max' function but am unsure how to vectorize these equations and get them to compare the data row by row.

Thanks.

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:ptc-3820221)

The bad news are that max() can't be vectorized.

The good news are that you can write your own max.. routine based on the built-in max and this routine can be vectorized.

For future questions, please state which version of Mathcad the question relates to and attach a worksheet wherever possible.

25.03.png

View solution in original post

3 REPLIES 3
Werner_E
25-Diamond I
(To:ptc-3820221)

The bad news are that max() can't be vectorized.

The good news are that you can write your own max.. routine based on the built-in max and this routine can be vectorized.

For future questions, please state which version of Mathcad the question relates to and attach a worksheet wherever possible.

25.03.png

Thanks! I'll give this a try. I'm working on an old worksheet in mathcad 15, but I also have mathcad prime 3.0 installed and could convert it if it would help.

Werner_E
25-Diamond I
(To:ptc-3820221)

Mathcad 15 is OK. Its the better and more powerful version anyway.

So for future questions turn in the sheet in whatever version you are working on.

Announcements

Top Tags