Memory / available storage space
5 次查看(过去 30 天)
显示 更早的评论
I have MATLAB installed on my D drive. If I run a MATLAB script that is located on my C drive, on which drive is memory used, C or D?
0 个评论
回答(1 个)
Walter Roberson
2016-3-14
MATLAB does not itself use memory on disks. MATLAB checks the MATLAB path to find out where functions are and loads them from where-ever they are. If you have code that save()'s files or imwrite() or otherwise creates files, then they are created where-ever the path indicates; if no directory is specified then they are created in the current directory at the time of execution of the statement.
If you run out of RAM and your operating system is configured to swap to disk to extend the amount of storage space, then the location of the swap space is something you configure in the operating system, and is not under MATLAB's control. See https://www.winhelp.us/set-paging-file-to-a-fixed-size-in-windows.html
3 个评论
Guillaume
2016-3-14
No. You need to learn the difference between computer memory (RAM) and hard drive. arrays are allocated in the computer memory which has nothing to do with your hard drive.
Saying that, you're never going to be able to create an array of size 10^69. You'd have to use nearly every atom in the universe to store that many elements.
Walter Roberson
2016-3-14
The zeros() function is built in to MATLAB, hard-coded in the application, so it would be read from which-ever hard drive you had MATLAB installed on at the time you launch MATLAB. But the memory that is allocated is going to come from your RAM, not from a hard drive.
All Mathworks supplied executables and libraries and .m code and .p code, will be read off of the hard drive it is installed on, unless you have put another file with the same name somewhere else and have given the other file priority (even if accidentally.) But that has nothing to do with where memory is allocated from.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!