フィルターのクリア

appending or padding zeros before a matrix in matlab

4 ビュー (過去 30 日間)
Malik
Malik 2013 年 4 月 21 日
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.

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 4 月 21 日
編集済み: Azzi Abdelmalek 2013 年 4 月 21 日
Maybe you did not correctly concatenate them?
u=[1 0 1 1]
u1=[zeros(1,7) u]
  1 件のコメント
Malik
Malik 2013 年 4 月 21 日
thanks! yes i wasn't concatenating correctly.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by