Creating vectors with components

11 visualizaciones (últimos 30 días)
Manasa Tarigoppula
Manasa Tarigoppula el 21 de Sept. de 2019
Respondida: Bruno Luong el 21 de Sept. de 2019
How do I create a 5-element column vector whose components are the squares of the elements of vector Row
  2 comentarios
David Hill
David Hill el 21 de Sept. de 2019
Look at transpose and basic matrix operations
Walter Roberson
Walter Roberson el 21 de Sept. de 2019
What do you want to do if the vector Row is not exactly 5 elements long ?

Iniciar sesión para comentar.

Respuestas (1)

Bruno Luong
Bruno Luong el 21 de Sept. de 2019
r=[3 2 7 5 2]
r(1:min(5,end)).^2.'
or
r(1:min(5,end)).'.^2

Categorías

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by