Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
yuz22/LoadAllData.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
15 lines (10 sloc)
531 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [AllDataMem] = LoadAllData(FileName) | |
%% output function'name input | |
%% Section 2: Load all the model data together | |
Contents = ncinfo(FileName); % Store the file content information in a variable. | |
for idx = 1: 8 | |
AllData(idx,:,:,:) = ncread(FileName, Contents.Variables(idx).Name); | |
fprintf('Loading %s\n', Contents.Variables(idx).Name); %display loading info | |
end | |
AllDataMem = whos('AllData').bytes/1000000; % or, more precisely, 1048576 | |
fprintf('Memory used for all data: %.3f MB\n', AllDataMem) | |