Mapping a matrix to another matrix

14 vues (au cours des 30 derniers jours)
rana karem
rana karem le 22 Juin 2021
Commenté : rana karem le 22 Juin 2021
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

Réponse acceptée

KSSV
KSSV le 22 Juin 2021
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 commentaire
rana karem
rana karem le 22 Juin 2021
Thanks alot

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by