How can I use NaN padding instead of zero padding in a MATLAB array?
Ältere Kommentare anzeigen
When I run the following example, zero padding is applied to the nonspecified indices of the array. I would like to have NaNs instead of zeros for the nonspecified indices.
X(1,1) = 7;
X(2,2) = 3;
X
This returns the following:
X =
7 0
0 3
The desired result is:
X =
7 NaN
Nan 3
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu NaNs finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!