Best practice for multiple Matlab session that want to call the same function from an .m file ?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Tuong Nguyen Minh
am 12 Sep. 2020
Beantwortet: Gaurav Garg
am 16 Sep. 2020
I run 10 matlab session - 10 GUI independently and each of these sessions want to call to the function that I wrote in a file called Calculation.m extensively.
The reason for this is because in a single matlab session I need to do parallel computation where each worker call the funtion Calculation.m concurently in a parfor loop.
I also run 10 of these matlab session using 10 different local profile: that is LocalProfile1,LocalProfile2,LocalProfile3...LocalProfile10 since I orbserve that If they use the same default local profile, they are extremely slow.
Which of these practice are prefer:
Method 1: 10 indepedent matlab session share the same Calculation.m
Method 2: 10 indepedent matlab session use independent Calculation1.m, Calculation2.m, Calculation3.m... Calculation10.m
Thank you very much
0 Kommentare
Akzeptierte Antwort
Gaurav Garg
am 16 Sep. 2020
Hi
Both of the methods would work fine without any changes in function (output behaviour) and/or performance.
That's because MATLAB creates a temporary file when you call a script/function for execution. So, in your case, you won't face any problem with either of the methods.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Startup and Shutdown 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!