Info
此问题已关闭。 请重新打开它进行编辑或回答。
Change matfile on harddrive
1 次查看(过去 30 天)
显示 更早的评论
Hi.
I am working a project with very much data. At one point I have to allocate space to a matrix that exceeds the capability of my computers RAM. As an example:
test = zeros(1000000, 14000);
This request cannot be made because "test" takes up 112 GB.
I then thought I could store the matrix on my harddrive and alter it without loading it entirely. Using:
save('test.mat', 'test', '-v7.3');
x = matfile('test.mat', 'Writable', true);
x.test(:, 123) = ones(1000000, 1);
This should change column 123 in the matfile on my harddrive to ones. My problem is that I cannot create the matrix to begin with, because it is too big.
I have then tried using:
test = sparse(1000000, 14000);
save('test.mat', 'test', '-v7.3');
x = matfile('test.mat', 'Writable', true);
This is all good, but when I try to rewrite the file,
x.test(:, 123) = ones(1000000, 1);
I get the error "Can't write file >PATH<".
Is there any way to save a matrix like the first example without first making it in your workspace? Or is there a way to rewrite the sparse matrix saved on the harddrive?
THANKS :D
0 个评论
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!