use LUT holding non integer numbers

Hi, i have a matrix of integers of values 0:200 and i have a LUT vector with 201 elements. i wanted to use the intlut function to insert the LUT values into the matrix, but the problem is that this funcrion restrict the LUT vector to be uint8/16 where my values are floating points. so basically i want to convert [1, 2, 3...] to [0.234, 4.323, ..] with the same logic of the intlut function that cell with value 4 will get the 4th calue in the LUT vec. is there another function that enables the LUT vector to be non int8? thanks

 採用された回答

Jan
Jan 2017 年 4 月 26 日

0 投票

LUT = rand(1, 201);
Data = randi([0, 200], 32, 32);
Result = LUT(Data + 1);

3 件のコメント

TZ
TZ 2017 年 4 月 27 日
Thank Jan!! didn't knew about LUT fuction
Jan
Jan 2017 年 4 月 27 日
There is no LUT function. LUT is a simple vector here and the look-up process is standard indexing.
TZ
TZ 2017 年 4 月 27 日
oh.. feel so stupid, i understand what you did, thanks.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeOperators and Elementary Operations についてさらに検索

質問済み:

TZ
2017 年 4 月 26 日

コメント済み:

TZ
2017 年 4 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by