Effacer les filtres
Effacer les filtres

copy element position from one vector to another

2 vues (au cours des 30 derniers jours)
Bianka Markovic
Bianka Markovic le 6 Juil 2021
Réponse apportée : KSSV le 6 Juil 2021
Hello everyone,
I'm trying to find a way where i copy the positions of NaN values in a onto the same positions in b. Does anyone has a suggestion what could work?
Thank you!
a=rand(100,1);
a(20:30)=nan;
a(60:80)=nan;
b=rand(100,1);

Réponses (1)

KSSV
KSSV le 6 Juil 2021
a=rand(100,1);
a(20:30)=nan;
a(60:80)=nan;
b=rand(100,1);
b(isnan(a)) = NaN ;

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by