Creating vectors with components

5 ビュー (過去 30 日間)
Manasa Tarigoppula
Manasa Tarigoppula 2019 年 9 月 21 日
回答済み: Bruno Luong 2019 年 9 月 21 日
How do I create a 5-element column vector whose components are the squares of the elements of vector Row
  2 件のコメント
David Hill
David Hill 2019 年 9 月 21 日
Look at transpose and basic matrix operations
Walter Roberson
Walter Roberson 2019 年 9 月 21 日
What do you want to do if the vector Row is not exactly 5 elements long ?

サインインしてコメントする。

回答 (1 件)

Bruno Luong
Bruno Luong 2019 年 9 月 21 日
r=[3 2 7 5 2]
r(1:min(5,end)).^2.'
or
r(1:min(5,end)).'.^2

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by