how to use LUT form configuring matrix

3 views (last 30 days)
TZ
TZ on 24 Apr 2017
Edited: Thorsten on 25 Apr 2017
Hi, i have a matrix, that i set up it will have 200 integer values. i also have a vector of 200 values. i want that each matrix cell will get the value of the vector, for example if cell (200,345) has a value of 20, then it will get the value of the 20th cell of the LUT vector. i know i can do it by double loop, but my matrix is very big and it will take a lot of time, i was wondering if there is a faster solution for the problem. thanks

Answers (1)

Thorsten
Thorsten on 24 Apr 2017
Use your matrix as index to LUT:
Mnew = LUT(M);
  2 Comments
Thorsten
Thorsten on 25 Apr 2017
Edited: Thorsten on 25 Apr 2017
Hi TZ, LUT is not a function. It is your vector with the 200 values. And M is your matrix.

Sign in to comment.

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!