Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Merging multiple matrices
Replies: 4   Last Post: May 9, 2013 10:56 AM

 Messages: [ Previous | Next ]
 Martijn van Sebille Posts: 1 Registered: 5/9/13
Merging multiple matrices
Posted: May 9, 2013 9:44 AM

Dear,

I am trying to efficiently merge multiple matrices, combining their maximal values. For example:
If A = [1 1 2; 1 2 1; 2 1 1] and B = [3 1 1; 1 3 1; 1 1 3], then their maximal values combined would be: C = [3 1 2; 1 3 1; 2 1 3].
I want to combine multiple matrices like this, up to 10. And these matrices can be quite big, up to 2000x2000.

At the moment I have several loops, which consider for every position (x,y) which of the values in each of the matrices is largest and then writes the largest to position (x,y) of the combined matrix.

It works fine, but can take very long, up to 20 minutes. Does anyone know of a more efficient method to achieve the same?

Thanks for any help.

Regards,
Martijn

Date Subject Author
5/9/13 Martijn van Sebille
5/9/13 Bruno Luong
5/9/13 Martijn van Sebille
5/9/13 Steven Lord
5/9/13 Martijn van Sebille