필터 지우기
필터 지우기

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 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