我想知道如何在给定的代码中处理瓶颈.
%% Points is an Nx3 matrix having the coordinates of N points where N ~ 10^6
Z = points(:,3)
listZ = (Z >= a & Z < b); % Bottleneck
np = sum(listZ); % For later usage
slice = points(listZ,:);
Run Code Online (Sandbox Code Playgroud)
目前for N ~ 10^6,np ~ 1000和number of calls to this part of code = 1000瓶颈声明总共花费大约10秒,与我的其余代码相比,这是一大块时间.

针对@EitanT请求的索引语句的示例代码的更多屏幕截图
