Mapping between two arrays wrt one column
    5 次查看(过去 30 天)
  
       显示 更早的评论
    
I have two matrices: A=[1 10; 2 20; 3 30] and B=[3 1 2]'
I want this to be my final answer A=[3 30;1 10;2 20] How do I do this?
0 个评论
采纳的回答
  Star Strider
      
      
 2017-12-25
        Use ‘B’ to define the rows of ‘A’:
A=[1 10; 2 20; 3 30]; 
B=[3 1 2]';
Anew = A(B,:)
Anew =
     3    30
     1    10
     2    20
0 个评论
更多回答(0 个)
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Multirate Signal Processing 的更多信息
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

