Replacing all values except NaN with column number
显示 更早的评论
I'm trying to convert
53 96 87
48 94 NaN
49 95 NaN
51 98 NaN
52 99 NaN
55 100 NaN
to
1 2 3
1 2 NaN
1 2 NaN
1 2 NaN
1 2 NaN
1 2 NaN
The best I can do is this, which of course fills each column (including the NaNs).
for a = 1:size(y,2)
for b = a
y(:,a) = b;
end
end
If anyone could point me toward a function that could work that would be very helpful. I've tried ~isnan(y) and others but they only allow one input argument.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Interpolation of 2-D Selections in 3-D Grids 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!