Creating vectors with components

조회 수: 4 (최근 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 CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by