Creating vectors with components

4 Ansichten (letzte 30 Tage)
Manasa Tarigoppula
Manasa Tarigoppula am 21 Sep. 2019
Beantwortet: Bruno Luong am 21 Sep. 2019
How do I create a 5-element column vector whose components are the squares of the elements of vector Row
  2 Kommentare
David Hill
David Hill am 21 Sep. 2019
Look at transpose and basic matrix operations
Walter Roberson
Walter Roberson am 21 Sep. 2019
What do you want to do if the vector Row is not exactly 5 elements long ?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

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

Kategorien

Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by