Placing a constant through a column

조회 수: 4 (최근 30일)
DARLINGTON ETAJE
DARLINGTON ETAJE 2019년 8월 28일
댓글: DARLINGTON ETAJE 2019년 8월 28일
Imagine this
A=(1:30)';
B=(31:60)';
C=(61:90)';
D=[A B C];
S = numel(B);
xx = reshape(B(1:S - mod(S, 3)), 3, []);
BB = sum(xx, 1).' / 3;
F=[A B C BB];
You will notice F is not possible because BB has just 10 variables (Dimensions of arrays being concatenated are not consistent.)
What I need to do is make each value in BB constant for 3 rows so that F can become possible.

채택된 답변

madhan ravi
madhan ravi 2019년 8월 28일
  댓글 수: 3
madhan ravi
madhan ravi 2019년 8월 28일
편집: madhan ravi 2019년 8월 28일
Use:
repelem(BB,3)
DARLINGTON ETAJE
DARLINGTON ETAJE 2019년 8월 28일
Thank you...you're such a blessing

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

추가 답변 (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