![]() Let’s calculate and plot the row average of our data.Įvery read has a bit of an overhead, so we want to balance the number of reads and the size of the data we bring into MATLAB's You can now treat your loaded data just as you would any data in MATLAB. loadedData2 = matObj.X(end-10:end, end-10:end) Instead of this way to avoid loading the whole variable. LoadedData = matObj.X(nrows-10:nrows, ncols-10:ncols) That using the end syntax causes MATLAB to load the entire variable in to memory. Indices can be a single value, a range of values, or a colon (:). This now loads the data into the workspace. This is similar to how you access the fields of structures in MATLAB.ĭisp(loadedData) 0.90579 0.35507 0.89227 0.31907 Now you can access variables in the MAT-file as properties of matObj, with dot notation. Whos matObj Name Size Bytes Class Attributes To read in part of a variable, first you create a object that corresponds to a MAT-File, such as matObj = matfile( 'myBigData.mat') īy running whos you can see that matObj is a matlab.io.MatFile object: Perfect for trying out this new partial read functionality. Whos -file myBigData Name Size Bytes Class Attributes ![]() You can use the following to to see what variables are available in your MAT-file ![]() We have a MAT-file (myBigData.mat) that contains the variable X. But now - it is possible to load in parts of your variable. Previously, there was a way to read in separate variables fromĪ MAT-file but not load parts of a single variable. Memory than loading the entire contents of that variable. For you who are running into memory limits, loading part of a variable requires less The new matfile function in R2011b allows you to efficiently load or save to parts of variables to MAT-Files. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |