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

6 vues (au cours des 30 derniers jours)
bassant tolba
bassant tolba le 27 Avr 2023
Réponse apportée : Matt J le 27 Avr 2023
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.

Réponses (1)

Matt J
Matt J le 27 Avr 2023
C=A;
C(logical(A))=B; %C is the result

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by