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

4 ビュー (過去 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 Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by