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일

0 개 추천

r=[3 2 7 5 2]
r(1:min(5,end)).^2.'
or
r(1:min(5,end)).'.^2

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

질문:

2019년 9월 21일

답변:

2019년 9월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by