Creating a matrix by some other matrices

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

 Respuesta aceptada

Image Analyst
Image Analyst el 12 de Mayo de 2014
Try this:
c = [a, b*ones(size(a))]

Más respuestas (2)

Categorías

Etiquetas

Preguntada:

Moe
el 12 de Mayo de 2014

Comentada:

Moe
el 12 de Mayo de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by