How to replace elements in a integer vector with chars using a lookup table
古いコメントを表示
I have a vector of unsigned integer (A) Nx1 uint8 (N>50000) populated with values from 0 to 6.
On the other hand there is a lookup table (B) 7x2 table, like this:
STATE CODE
----- ----
'Str 1' 0
'Str 2' 1
... ...
'Str 7' 6
class(B.STATE) --> cell
class(B.CODE) --> double
Question: How can I obtain a vector of strings (C) with a size Nx1, with each element being the match in the lookup table?
Example: A(i) = 6 --> C(i) = 'Str 7'
Thanks for your support.
E.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Approximate Functions with Lookup Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!