Adding zeros to an array

2 visualizzazioni (ultimi 30 giorni)
RDG
RDG il 9 Set 2013
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];

Risposta accettata

Walter Roberson
Walter Roberson il 9 Set 2013
OutPut = B;
OutPut(3,4) = 0;

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by