Mapping a matrix to another matrix

16 ビュー (過去 30 日間)
rana karem
rana karem 2021 年 6 月 22 日
コメント済み: rana karem 2021 年 6 月 22 日
I have 2 matrices and want to use them to create another third one.. e.g I have A=[3;7;8;9;2;10] and B=[4,6;1,2;3,5]
i want to replace 1 in B by the 1st element in A, then 2 in B by the 2nd element in A and so on .....so the result will be=[9,10;3,7;8,2]
Any help is much appreciated. Thanks

採用された回答

KSSV
KSSV 2021 年 6 月 22 日
A=[3;7;8;9;2;10];
B=[4,6;1,2;3,5];
C = A(B)
C = 3×2
9 10 3 7 8 2
  1 件のコメント
rana karem
rana karem 2021 年 6 月 22 日
Thanks alot

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by