nno / surfing

a Matlab / Octave toolbox for surface-based voxel neighborhood selection on the cerebral cortex, intended for informationg mapping of functional magnetic resonance imaging (fMRI) data
Other
15 stars 8 forks source link

Error when `i` is vector of vertex indices and `r` is [ ] in `surfing_subsurface()` #3

Closed HaiyangJin closed 2 years ago

HaiyangJin commented 2 years ago

Error ("Arrays have incompatible sizes for this operation. for line71 si=find(nsel==i);) happens when i is vector of vertex indices and r is [ ] in surfing_subsurface(). But it works when i is only one value and r is not empty (which is the case for node selection).

One possible solution is to modify Line 71 as the following, which should be compatible for both cases.

si=arrayfun(@(x) find(nsel==x), i);