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: LUT/vectorize this for-loop
Replies: 1   Last Post: Feb 12, 2013 11:14 AM

Advanced Search

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

Posts: 85
Registered: 7/21/09
LUT/vectorize this for-loop
Posted: Feb 12, 2013 11:07 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


I have been dabbling trying to make a look-up table mapping for this tedious for-loop but I wasn't successful. Here is the code and explanation of what I am trying to do:

for kk=1:size(aa,1)

My 'kk' is in order of millions for this loop is somehow time consuming.

Basically, I have a matrix called 'aa'.

'aa' is some Nx4 matrix where each row has mapping values.

What I want to do is going through row by row of matrix 'aa' and map image value 'img' to its corresponding place in image 'imageModified'.

For example,

Let's say aa=[ 50 40 60 70 ;
2 56 28 10 ;
.... ]

So what I want to do is: map img(50,40) value to location imgModified(60,70). Map map img(2,56) value to location imgModified(28,10). And do that for aa N rows.

Thank you in advance,

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.