Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Change matfile on harddrive

1 visualizzazione (ultimi 30 giorni)
Michael Madelaire
Michael Madelaire il 21 Mar 2017
Chiuso: MATLAB Answer Bot il 20 Ago 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

Risposte (0)

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by