One Multi Dimensional Array or Several Two Dimensional Arrays ?
Show older comments
Hello everyone, I'm writing a code that includes calling back a specific variable several times, i used Matlab Profiler in order to determine the specific time for every part of the code and it was 95 % of the run time associated with calling back the variable values, Now the variable that's being called back is actually 9 variables or 9 arrays f1(i,j), f2(i,j) , f3 (i,j),... etc. where i,j are changing using a for loop in order to fill the arrays, So i have 9 arrays that are Two Dimensional,
My question is, Which is faster: 1) To run the code as it is using 9 Two Dimensional Arrays f1(i,j), f2(i,j), f3(i,j) ...etc. or 2) To use One Multi Dimensional Array f(i,j,1) , f(i,j,2) , f(i,j,3) ... etc.
Knowing that the functions f1,f2,f3.. etc. are not dependent on each other (can i run in parallel ?).
My Goal is to minimize the code run time.
Thanks in advance
Mahmoud
Accepted Answer
More Answers (0)
Categories
Find more on Numeric Types in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!