How can I use NaN padding instead of zero padding in a MATLAB array?
Show older comments
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
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!