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?
5011CEM/2a Data Exploration/LoadHours.m
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
23 lines (22 sloc)
887 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
%% List variable names | |
% note that variable 3 is an ensemble, we will NOT use this in our project! | |
% Not each model is 700 x 400 x 12 and we know that lat, lon and time match | |
% these numbers. | |
% To visulaise this 3D array think of it as a 700 x 400 grid for each model | |
% for one hour. These are stacked up 25 high. | |
function [AllHorsMem] = LoadAllHors(FileName) | |
%UNTITLED2 Summary of this function goes here | |
% Detailed explanation goes here | |
ExploreData; | |
Contents = ncinfo(FileName); | |
NumVariables = size(Contents.Variables,2); | |
fprintf('Variable names and sizes:\n') | |
for idx = 1: NumVariables | |
AllHors(idx,:,:,:) = size(Contents.Variables,2); | |
fprintf('%i %s %i, %i, %i',... | |
idx, Contents.Variables(idx).Name, Contents.Variables(idx).Size); | |
fprintf('\n'); | |
end | |
AllHorsMem = whos('AllHors').bytes/1000000; | |
fprintf('Memory used for Hour: %.3f MB\n', AllHorsMem) | |
end |