How can I center a matrix containing NaN values?
1 次查看(过去 30 天)
显示 更早的评论
I have a matrix of size 72x144. It contains many NaN values, but also contains numeric values. I have been successful in the past at centering matrices containing only numeric values using the following code:
xctr=bsxfun(@minus, x, sum(x)/size(x, 1));
However, this seems to output a matrix with all NaN values, rather than giving me many NaN values, and also the centered numerical values. How can I center the data without turning everything into NaN?
2 个评论
Image Analyst
2013-10-30
What does it mean to "center" a matrix with nan's sprinkled throughout it? Can you give a small example of the input matrix and desired output matrix?
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 NaNs 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!