Case 1:
I have a nested for loop to run large realizations and save variables generated through that loop in .mat files, which I can later use in another program.
Case 2:
I can make the function of the above mentioned loop and call it directly in the other program where I want to use the variables generated by the above loop.
The only disadvantage I find of Case 1 is that every time I make some changes in that loop, I must run it again and save the updated variable.
- Which case among the above two cases is the better option?
- Which would be more fast -
a) if I run that loop directly in the main program (not using .mat file), or
b) develop a function for that loop and then call it in the main program?