Adding zeros in the empty places in a matrix.

조회 수: 1 (최근 30일)
S Priya
S Priya 2021년 11월 12일
답변: KSSV 2021년 11월 12일
A is a 252x1 matrix, and I have values of 1st 13th 25 th 73th 121th 109th 97th 61th row. and have to fill the remaining spaces with zeros. Please help me with it.

채택된 답변

KSSV
KSSV 2021년 11월 12일
A = rand(252,1) ;
iwant = zeros(252,1) ;
idx = [1 13 25 73 121 109 97 61] ;
iwant(idx) = A(idx) ;

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by