比如说有M阶矩阵U和V,
现在要生成一个N阶矩阵W,如图片所示,要怎么处理。
U V
       U V U
           U V U...
               UVU]

 Akzeptierte Antwort

reviras
reviras am 14 Mai 2023

0 Stimmen

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)

Weitere Antworten (0)

Kategorien

Mehr zu 语言基础知识 finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 14 Mai 2023

Beantwortet:

am 14 Mai 2023

Community Treasure Hunt

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

Start Hunting!