在Matlab中进行轮廓绘图时的内存错误

时间:2015-02-13 13:30:27

标签: matlab memory plot contour

当我尝试从我的数据集中绘制轮廓图时,内存不足。在我的数据文件(data.txt)中,我有三列数据,每列专门用于x,y和z。在了解了轮廓绘图之后,我只是尝试创建一个x和y的网格,然后为网格中的每个节点分配一个z值。我的代码如下:

    *clf
dirname_out = '/home/Riyal/Documents/F/Contplot/plot112/';
fignam = 'cont_h.eps';
figure(1);*
load node.txt
x=node(:,2); %set the x-axis data(e.g.-x distance)
y=node(:,1); %set the y-axis data(e.g-time)
z=node(:,3); %set the variable to plot(e.g-velocity)
% x=~isnan(x);
% y=~isnan(y);
% z=~isnan(z);
a=size(node);
b=a(:,1);
xlin=linspace(-4.3862592576,4.9999996647,b);
ylin=linspace(0.0020000001,88.1880041887,b);
%v=[2.4,2.2,2.0,1.8,1.6,1.4,1.2,1.0,0.8,0.6,0.4,0.2,0.16,0.12,0.08,0.04,0.01,0.001,0.0001];
[X,Y]=meshgrid(xlin,ylin);
Z=griddata(x,y,z,X,Y);
mesh(X,Y,Z);
[C,h]=contour(X,Y,Z);
clabel(C,h,'FontSize',10,'Color','b','Rotation',0);
grid on
axis on
xlabel('distance');
ylabel('time');

% ------------------------------
% Information on Figure size
% ------------------------------

set(gcf, 'PaperUnits', 'centimeters');
set(gcf, 'PaperType', 'A4');
%set(gcf, 'PaperOrientation',  'portrait');
 set(gcf, 'PaperOrientation', 'Landscape');

PaperSize = get(gcf,'PaperSize');   % %   Use PaperSize to return the
                                    % %   size of the current paper.%
%width =19.0;
%height = 26.0;

 width = 26.0;                     % % Initialize a variable for width.
 height = 19.0;                    % % Initialize a varible for height.

left = (PaperSize(1)- width)/2;     % % PaperSize (width of paper) for the calculation.
bottom = (PaperSize(2)- height)/2;  % % of PaperSize (height of paper) for the calculation.
myfiguresize = [left, bottom, width, height];   % % Set the figure size and print.
set(gcf, 'PaperPosition', myfiguresize);


% ------------------------------
% Printing to file
% ------------------------------

当我绘制比我目前使用的数据集更大的数据集时,任何人都可以让我知道为什么Matlab会说下面的问题。我猜我的其中一条线路有问题,或者有更好的方法可以通过最佳使用内存来完成工作? 感谢。

Out of memory. Type HELP MEMORY for your options.

Error in meshgrid (line 59)
        yy = ycol(:,ones(size(xrow)));

0 个答案:

没有答案