Essentially, I have two arrays of the same size, one contains some NaNs and I want to remove the corresponding points in the second array
I have the equation:
SOAM = nansum(CP(1:(n-3)))/sum(norm(fixed_xyz(2:n,:)-fixed_xyz(1:n-1,:)));
- CP contains values from 0-180 with some NaN size = 100,3
- fixed_xyz contains binary values with no Nan size = 100,3
Using "nansum" you can ignore NaNs but I want to avoid the corresponding points in the array "fixed_xyz".
i.e.
for k = 1:size(CP) if CP(k) = NaN CP(k) = [] fixed_xyz(k) = [] endend
Trouble with this is that the loop reduces the size of CP making the itteration of the for loop over step the actual size and an error occurs.
How can I get around this? Is there a simpler notation for this?
Cheers, Will
Best Answer