Replace the numbers in an array

2 Ansichten (letzte 30 Tage)
Anna Sidiropoulou
Anna Sidiropoulou am 11 Jan. 2021
Beantwortet: James Tursa am 11 Jan. 2021
Hello, I have an array like
A[ ]: B[ ]:
-nan 2.1
0.63 4.2
-nan 2.8
-nan
0.35
1.2
-nan
and I need to replace only the numbers with the numbers of a second array B[ ]. Could you help me?

Antworten (1)

James Tursa
James Tursa am 11 Jan. 2021
A(~isnan(A)) = B;

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by