Assign column vector to a matrix row
Mostrar comentarios más antiguos
This always works, but why? Is it legal?
vert = [1:4]',
horiz = [11:14],
mat = zeros(4,4)
mat(2,:)=vert,
mat(3,:)=horiz
My vector is a column vector return by a function. I'm hoping to avoid an extra step just to transpose it.
2 comentarios
Azzi Abdelmalek
el 18 de Jul. de 2014
What is your problem?
Andrew Reibold
el 18 de Jul. de 2014
This question made me laugh really hard, but I'm going to try to maintain professionality.
What are you trying to ask when you say "Is it legal?" I'm assuming you don't mean "Is it against the law?" !
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!