怎么样给分块矩阵赋值?。

조회 수: 23 (최근 30일)
paepon
paepon 2023년 3월 29일
답변: rerecang 2023년 3월 29일
比如说有M阶矩阵U和V,
现在要生成一个N阶矩阵W,如图片所示,要怎么处理。
U V
       U V U
           U V U...
               UVU]

답변 (1개)

rerecang
rerecang 2023년 3월 29일
U=4;V=2;len=10;
diag(ones(1,len)*U,0)+diag(ones(1,len-1)*V,-1)+diag(ones(1,len-1)*V,1)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by