How can I speed my function?
조회 수: 1(최근 30일)
Andrew Newell 2017년 4월 22일
One source of delays can be repmat. This can be replaced by a suitable choice of index, as in the following:
r = R(i,:);
r = r(ones(N,1),:);
See Matlab Indexing and Repmat Replacement for a discussion of this issue.
That said, it may be too much to expect a really fast implementation of this algorithm, judging by this discussion of the algorithm.