Adding zeros to an array

조회 수: 4 (최근 30일)
RDG
RDG 2013년 9월 9일
Suppose I have 2 arrays:
A=[1 2 3 4;
2 3 4 5;
3 4 5 6];
B=[5 1 3;
1 3 4];
How can I append zeros to matrix B such that:
Output=[5 1 3 0;
1 3 4 0;
0 0 0 0];

채택된 답변

Walter Roberson
Walter Roberson 2013년 9월 9일
OutPut = B;
OutPut(3,4) = 0;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by