From: Kyle on 3 Aug 2010 10:13 I would like to know how to read in part of a variable from a .mat file. My problem is this: I have a .mat file with a variable which is, say, 12000 x 73 x 144. It is much less memory intensive to do my analysis using a portion of that data... so right now I am reading in the entire variable, keeping the first 2000 entries and clearing the rest. What I'd like to do is only read 2000 entries to begin with, so that I don't have to waste time reading in the entire variable, only to clear most of it right away. Any ideas? Unfortunately load(file.mat,'variable(1:2000,:,:)') doesn't work...
From: us on 3 Aug 2010 10:18 On Aug 3, 4:13 pm, "Kyle " <kyle.macritc...(a)gmail.com> wrote: > I would like to know how to read in part of a variable from a .mat file. My problem is this: > > I have a .mat file with a variable which is, say, 12000 x 73 x 144. It is much less memory intensive to do my analysis using a portion of that data.... so right now I am reading in the entire variable, keeping the first 2000 entries and clearing the rest. > > What I'd like to do is only read 2000 entries to begin with, so that I don't have to waste time reading in the entire variable, only to clear most of it right away. > > Any ideas? Unfortunately load(file.mat,'variable(1:2000,:,:)') doesn't work... currently, ML does not support such a feature/option... us
From: Andy on 3 Aug 2010 10:24 "Kyle " <kyle.macritchie(a)gmail.com> wrote in message <i3985g$aeu$1(a)fred.mathworks.com>... > I would like to know how to read in part of a variable from a .mat file. My problem is this: > > I have a .mat file with a variable which is, say, 12000 x 73 x 144. It is much less memory intensive to do my analysis using a portion of that data... so right now I am reading in the entire variable, keeping the first 2000 entries and clearing the rest. > > What I'd like to do is only read 2000 entries to begin with, so that I don't have to waste time reading in the entire variable, only to clear most of it right away. > > Any ideas? Unfortunately load(file.mat,'variable(1:2000,:,:)') doesn't work... FWIW, 2000 rows of a 3D array is not the first 2000 entries. Also, if you will frequently be using only this portion of the array, then perhaps you should store it separately in its own .mat file.
|
Pages: 1 Prev: fsolve Problem with 2 non-linear functions Next: fzero with two variables |