Vectorizing nested for loop
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello everyone. Im kinda new to matlab, please help to vectorize this
for ii = 1:100
for jj = 1:100
func1(ii, jj);
func2(ii, jj);
end
end
func1 using data, generated by func2 on each step, so i cannot tear execution apart. Problem is speed, i need as much as i can, but profiler says tht my loop is taking most of time, so i've read vectorization part of help, tried meshgrid option, but it kinda not what i am looking for. General idea would be to like execute both functions, using pregenerated data as entry parameters (saving call order), that would look same as generated but for loop.
Thanks for your help!
2 Kommentare
Torsten
am 9 Dez. 2022
func1 using data, generated by func2 on each step
That contradicts your code where both functions are independent of each other.
How are the two functions coupled ?
Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!