what segment of memory does the matlab primary work space and function work space occupies?

what segment of memory(data segment, stack segment) does the matlab primary work space and function work space occupies?

 Risposta accettata

Not sure we understand your question completely, or why you are asking it. The memory for variable data typically comes from the heap, allowing for very large variables depending on your system memory and how fragmented it is. Is that what you are asking?

5 Commenti

Matlab's primary work space is different from m function files work space, is it right? If yes, say the two work space share a variable with same name, will it not create conflict upon calling if both are stored in same segment of memory? Like in C programming language local variables occupy stack segment and global variables occupy data segment.
Yes. Each function workspace is separate from other function workspaces and local names will not clash with each other. Local variable names inside functions, although they are created from the heap, do not clash with same-named variables in another function's workspace which are also created from the heap. They also don't clash with global variable names if that name is not declared as global inside the function. MATLAB does all of this name bookkeeping for you as part of memory management.
And where that heap lies? which segment of memory? And could you please explain how matlab does that bookkeeping, may be refer me to a link that discusses this thing? Thanks for your response.
The heap is basically your main computer memory that all of your programs have access to through the operating system. For the variable name and workspace bookkeeping, that is proprietary to MATLAB and I am not aware of any official documentation discussing the details beyond the basics of what I have already written.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su MATLAB Coder in Centro assistenza e File Exchange

Richiesto:

il 8 Giu 2014

Commentato:

il 11 Giu 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by