Filter löschen
Filter löschen

appending or padding zeros before a matrix in matlab

4 Ansichten (letzte 30 Tage)
Malik
Malik am 21 Apr. 2013
hello, if i have a matrix
u = [1 0 1 1]
and i want to append zeros before it upto a length n:
u1 = [0 0 0 0 0 0 0 1 0 1 1]
where n =7.
How should i? i tried this
zeros(1,n)
then tried to concatenate it with u but couldnt concatenate either.
regards.

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 21 Apr. 2013
Bearbeitet: Azzi Abdelmalek am 21 Apr. 2013
Maybe you did not correctly concatenate them?
u=[1 0 1 1]
u1=[zeros(1,7) u]

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by