adding a zero element in a specific location in array (between two elements)

조회 수: 6 (최근 30일)
bassant tolba
bassant tolba 2023년 4월 27일
답변: Matt J 2023년 4월 27일
I have two array. one is 100x1 which contain two zeros elements and a shorter arrray with 98x1 elements which does not has zeros elements
I need to insert the same zeros locations of A matrix in B matrix locations to make it 100x1.

답변 (1개)

Matt J
Matt J 2023년 4월 27일
C=A;
C(logical(A))=B; %C is the result

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by