Creating vectors with components
Afficher commentaires plus anciens
How do I create a 5-element column vector whose components are the squares of the elements of vector Row
2 commentaires
David Hill
le 21 Sep 2019
Look at transpose and basic matrix operations
Walter Roberson
le 21 Sep 2019
What do you want to do if the vector Row is not exactly 5 elements long ?
Réponses (1)
Bruno Luong
le 21 Sep 2019
r=[3 2 7 5 2]
r(1:min(5,end)).^2.'
or
r(1:min(5,end)).'.^2
Catégories
En savoir plus sur 2-D and 3-D Plots 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!