circshift function speed up
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Direct Search en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!