Creating a matrix by some other matrices
Afficher commentaires plus anciens
Suppos I have:
a = [3;3;5;8;2;1;8;1;5];
b = 2
I want matrix c to be:
c = [3 2;3 2;5 2;8 2;2 2;1 2;8 2;1 2;5 2]
second column of matrix c is just repeated b
Réponse acceptée
Plus de réponses (2)
Azzi Abdelmalek
le 12 Mai 2014
Modifié(e) : Azzi Abdelmalek
le 12 Mai 2014
[a 2*ones(size(a))]
1 commentaire
Moe
le 12 Mai 2014
Catégories
En savoir plus sur Resizing and Reshaping Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!