Replacing arrays within a matrix

조회 수: 7 (최근 30일)
Rob
Rob 2018년 2월 27일
답변: KSSV 2018년 2월 27일
Really quick question.
How do I replace in one command for instance, in a matrix of 4x4, the first two rows by a vector v, and the other two rows by a vector u?

답변 (1개)

KSSV
KSSV 2018년 2월 27일
As you are replacing all the elements of the matrix..why you want to go for replace? You create a different matrix itself.....
u = rand(1,4) ;
v = rand(1,4) ;
iwant = [u ; u ;v ;v ]

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by