How to store values in matrix with similar index number of other matrix?

I have one matrix A=[1 2 1 3 3 2 2 1 3 ] and another matrix B=[72 24 67]. Now want to generate new matrix with the values i.e 1=72 , 2=24 and 3=67 with similar index number of A. The new A matrix will be, A_new=[72 24 72 67 67 24 24 72 67]. How I will be getting this new matrix of A_new?Please help me to solve this

 採用された回答

Alex Sune
Alex Sune 2020 年 3 月 3 日
A_new = B(A)

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

質問済み:

AS
2020 年 3 月 3 日

コメント済み:

AS
2020 年 3 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by