필터 지우기
필터 지우기

array [10x8]

조회 수: 1 (최근 30일)
bala k
bala k 2011년 4월 19일
G(1,:)=[ 1 2 3 8 5 6 3 5];
for j = 1:10,
for i = 1:8,
n(j,i)=G(1,8);
end
end
i need to calculate 10 rows and 8 columns, G value is = [ 1 2 3 8 5 6 3 5];
i couldn't get the G value in 10 rows.

채택된 답변

Jan
Jan 2011년 4월 19일
G = [ 1 2 3 8 5 6 3 5];
n = repmat(G, 10, 1)
or
n = G(ones(1, 10), :);
  댓글 수: 2
bala k
bala k 2011년 4월 19일
sir, if the G value is change in each row. how to i change the code.
Walter Roberson
Walter Roberson 2011년 4월 19일
for j = 1:10,
for i = 1:8,
n(j,i)=G(1,i);
end
end

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by