circshift function speed up
조회 수: 8 (최근 30일)
이전 댓글 표시
Hello, I'm trying to optimize my code. I'm using circshift function in my code. I was wondering whether there is a way to speed up the loop which is using circshift cause according to the profiler most of the time spent on running the code is spent by circshift. Either by changing the circshift or some other solutions. I have also tried to do normal indexing rather than using circshift but it's taking more time. Here is my code:
for i = 1:BitLength
d(i) = xor(initialState(2),initialState(1));
initialState = circshift(initialState,[0,1]);
initialState(1) = d(i);
end
I tried the following code but it didn't help:
for i = 1:BitLength
d(i) = xor(initialState(2),initialState(1));
initialState =initialState ([end 1:end-1]);
initialState(1) = d(i);
end
Thanks.
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Direct Search에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!