Array comparisons
Array comparisons
(OP)
I am new at arrays in Mathcad. How can you compare the corresponding values in 2 arrays and write the maximum of the 2 to a new array?
For instance I have an array called "a" which has 1 column and 3 rows. I want to compare each value to the same position in "b" and write the maximum for each position to a new array called "c".
When I use c=max(a,b) it just returns one value for "c" instead of a new array.
For instance I have an array called "a" which has 1 column and 3 rows. I want to compare each value to the same position in "b" and write the maximum for each position to a new array called "c".
When I use c=max(a,b) it just returns one value for "c" instead of a new array.





RE: Array comparisons
i:= 1..rows(a)
c:=max(a[i,b[i)
Rick D.
RE: Array comparisons
Also, the above posting should say c[i:max(a[i,b[i) if you want to go that route.
TTFN
RE: Array comparisons
=========================================================
=========================================================
=========================================================
RE: Array comparisons
Sorry, i don't know if that will work, it just seems likely.
Cheers
Greg Locock
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
RE: Array comparisons
The error message relates to trying to access a[3 and b[3, which don't exist.
TTFN
RE: Array comparisons
It worked!! look,.....