Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: saving memory while doing global scaterm plotting
Replies: 1   Last Post: Nov 4, 2013 11:13 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Jonathan W Smith

Posts: 87
Registered: 12/17/10
saving memory while doing global scaterm plotting
Posted: Nov 3, 2013 6:28 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Good morning: The code below plots but terminates the entire MATLAB program mid-way through plotting. I think its likely insufficient memory because of fragmented memory use. Are there any suggestions on how to have this a have an entire graph plot while conserving memory. Thanks.

clear all

latlim = [-60 60];

lonlim = [-180 180];

load('coast.mat')

sounder_files = dir('*.nc');

num_files = length(sounder_files);

i_des_file=0; i_asc_file=0;


for i_files = 1:num_files;

DES{i_files} = logical(ncread([sounder_files(i_files).name], 'Ascending_Descending'));
LAT{i_files} = ncread([sounder_files(i_files).name], 'Latitude');

LON{i_files} = ncread([sounder_files(i_files).name], 'Longitude');
ozone{i_files} = ncread([sounder_files(i_files).name], 'O3_MR');

if all(DES{i_files})
i_des_file = i_des_file + 1;
des_files{i_des_file} = sounder_files(i_files).name;

axesm('robinson','MapLatLimit',latlim,'MapLonLimit',lonlim,'Frame','on','Grid','on','MeridianLabel','on','ParallelLabel','on');
scatterm(LAT{i_des_file},LON{i_des_file},6,ozone{i_des_file}(47,:),'filled');

else
i_asc_file = i_asc_file + 1;
asc_files{i_asc_file} = sounder_files(i_files).name;

end

end

hold on

map_line = plotm(lat,long,'k');

set(map_line,'LineWidth', 2.5);

colorbar('location','southoutside');

caxis([60 120]);

print -depsc o3_125_ASC_NUCAPS.eps


Jonathan



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.