Alternative method needed for a few 'for' loops inside each other
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hi,
I have 4 for loops inside each other as seen here:
for A=1:a
for B=1:b
for C=1:c
for D=1:d
do_something (A,B,C,D)
end
end
end
end
The values of A, B, C, D are dependent on each other so I can't calculate them separately. The issue is that this is extremely slow. Could anyone please help me with an alternative fast method? Thank you very much for your time and help.
0 Commenti
Risposte (1)
Jan
il 8 Mar 2015
No. It is impossible to give a useful suggestion based on this abstract code. The problem is not the nested loops, but the code hidden behind "do_something". The explanation "A, B, C, D are dependent" does not allow to understand the underlying concept.
The profiler helps to identify teh bottlenecks of the program. Use it and post the corresponding code in a less simplified manner. Then a helpful suggestion is possible.
4 Commenti
Vedere anche
Categorie
Scopri di più su Surface and Mesh Plots in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!