circshift function speed up
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (0)
Vedere anche
Categorie
Scopri di più su Direct Search in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!