Calling the same function from multiple scripts
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am calling a function from multiple scripts in separate Matlab windows at the same time. Would this affect my function's output? Would this make the process slow?
0 comentarios
Respuestas (1)
Walter Roberson
el 30 de Oct. de 2015
It should be fine as long as you are avoiding "clear all" and "clear functions"
2 comentarios
Walter Roberson
el 30 de Oct. de 2015
It depends what you mean by "separate MATLAB windows". If you mean that you started multiple sessions each with its own command window, then they will not interfere with each other (provided you are not changing the .m files as you go!).
If you mean multiple figures, all started from the same command window, then Yes, the global variables would be shared. global variables apply across all activities within the same process.
If you are trying to use global variables with the Parallel Processing Toolbox then you need to know that the contents of global variables are not copied from the original process to the workers, and changes to the globals on one worker do not affect the other workers.
Ver también
Categorías
Más información sobre Whos en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!