PDA

查看完整版本 : [MATLAB基础] 哭着求人~~~


mingruoshui
2010-04-24, 21:45
想用matlab画压力云图但是画出来的有网格,想把网格去掉,求求各位高手帮帮忙,可以提供10000组X,Y和P值,放在一个dat文件里。下面是我原来的程序,不要说加shading interp,shading flat grid off等,因为不好使:
clc
clear all
close all
figure(1)
[number x y p rho itype]=textread('data/f_state.dat','%d %f %f %f %f %d');%读取数
TRI = delaunay (x,y);
TRI = [TRI TRI(:,1)];
colormap_rows = 64*10 ;
CM = jet (colormap_rows) ;
colormap (CM) ;
for i=1:length(TRI)
p1(i)=(p(TRI(i,1))+p(TRI(i,2))+p(TRI(i,3)))/3;
end
p1max=max(max(p1));
p1min=min(min(p1));
C_p1 = p1max-p1min ;
t = (p1max-p1) / C_p1 ;
jet_num = round (1 * t + colormap_rows * (1-t));
for i=1:length(TRI)
fill(x(TRI(i,:)),y(TRI(i,:)),CM(jet_num(i),:))
hold on
end
brighten(0.5)
axis equal
xlabel('x/m');
ylabel('y/m');
pmax=max(max(p));
pmin=min(min(p));
caxis([pmin,pmax])
colorbar
saveas(gcf,'chuli\p0','emf');

laosam280
2010-05-08, 17:05
难道在整个程序运行后,来个grid off 不可以?