现在的位置: 首页 > 综合 > 正文

Matlab中将格点数据转换成等值线并存储

2013年08月01日 ⁄ 综合 ⁄ 共 300字 ⁄ 字号 评论关闭

 

clear all;
Z=[0   0   0   0   0   0
   0   0   0   20   0   0
   0   0   20  0   0   0
   0   0   0   0   0   0
   0   0   0   0   0   0];
X = [1:6];
Y = [1:5];
v = [1 5 10 15 20];
figure('visible','off');
[C,h] = contour(X,Y,Z,v);
clabel(C,h);

xx = C(1,:);
yy = C(2,:);

R = C';
[rowCount,colCount] = size(R)
fid = fopen('f:\aaa.txt','w');
for row=1:rowCount
    fprintf(fid,'%g ',R(row,:));
    fprintf(fid,'%s\r\n','');
end
fclose(fid);

 

抱歉!评论已关闭.