The Math Forum

Search All of the Math Forum:

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

Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Martijn van Sebille

Posts: 1
Registered: 5/9/13
Merging multiple matrices
Posted: May 9, 2013 9:44 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


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.


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.