필터 지우기
필터 지우기

How to add constant values above and below of each columns of a matrix?

조회 수: 2 (최근 30일)
Hello,
I have a matrix say VP of size 100 * 106 and I want to add 50 constant values above and 50 values belowhis matrix (50 values on each column above and below) . How can I do it?

채택된 답변

Kevin Holly
Kevin Holly 2022년 11월 4일
VP = rand(100,106);
extra50 = rand(50,106);
NewVP = [extra50;VP;extra50];
size(VP)
ans = 1×2
100 106
size(NewVP)
ans = 1×2
200 106

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by