Effacer les filtres
Effacer les filtres

replace one matrix with the positon indicated in another matrix

2 vues (au cours des 30 derniers jours)
tanveer haq
tanveer haq le 19 Nov 2018
Commenté : tanveer haq le 19 Nov 2018
I have two large matrices, for instance
A = [1 3 3 4];
B = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16 ] ;
matrix A represents the postion of numbers of matrix B.
Now how to write B as:
B = [1 3 3 4 ; 5 7 7 8 ; 9 11 11 12; 13 15 15 16];

Réponse acceptée

Bruno Luong
Bruno Luong le 19 Nov 2018

Plus de réponses (1)

KSSV
KSSV le 19 Nov 2018
A = [1 3 3 4];
B = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16 ] ;
B(:,2) = B(:,2)+1 ;

Catégories

En savoir plus sur Resizing and Reshaping Matrices 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