How can i replace elements from first matrix to second without changing the size of second matrix?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
suchismita
le 28 Juin 2014
Commenté : suchismita
le 28 Juin 2014
I have a matrix
A=[1 3 4 6];
and
B=[1 5 6 9 10 12 18];
the length of A is 4 and B is 7. Now i want to change the elements of B by changing first 4 elements of A in B.Final output i want is
B=[1 3 4 6 10 12 18]
How it can be done?
Please help me...
0 commentaires
Réponse acceptée
the cyclist
le 28 Juin 2014
Modifié(e) : the cyclist
le 28 Juin 2014
B(1:4) = A;
or more generally
B(1:length(A)) = A;
Plus de réponses (0)
Voir également
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!