Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Change matfile on harddrive

1 Ansicht (letzte 30 Tage)
Michael Madelaire
Michael Madelaire am 21 Mär. 2017
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by