Creating vector from a matrix

조회 수: 2 (최근 30일)
Berkay
Berkay 2022년 8월 29일
댓글: Chunru 2022년 8월 30일
I want to create a column vector from every second element of the matrix
how can I do it?

답변 (1개)

Chunru
Chunru 2022년 8월 29일
편집: Chunru 2022년 8월 30일
A = randn(3:4)
A = 3×4
-1.8158 0.3369 1.9546 0.1616 -0.6009 -0.4416 -0.0984 1.6391 3.4299 -0.4452 -0.7799 1.4173
v = A(1:2:end)'
v = 6×1
-1.8158 3.4299 -0.4416 1.9546 -0.7799 1.6391
  댓글 수: 2
Berkay
Berkay 2022년 8월 30일
Yes That's what I want but how can I write this vector as column vector?
Chunru
Chunru 2022년 8월 30일
Use " ' ". See above.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by