clear;
w=1.27:0.01:3;
h=0:0.01:1.73
for i=1:174
for j=1:174
Y(i,j)=606449382195.20000000000000000000.*exp((-7.8186968838526912181303116147309.*w(i).^4-1.4164305949008498583569405099150).*(1.-1.*h(j))).*sinh(.16489422355089917061349150141643e-11.*(6708298677659438545710450.*w(i).^4-176380388135181260069835000.+22483186824942380862406656.*w(i).^8).^(1./2).*(1.-1.*h(j))).*cos(w(i).*(16.670000000000000000000000000000-16.670000000000000000000000000000.*h(j)))./(6708298677659438545710450.*w(i).^4-176380388135181260069835000.+22483186824942380862406656.*w(i).^8).^(1./2);
end
end
surf(w,h,Y)
hold on
grid on
xlabel('w')
ylabel('h')
zlabel('y')
title('被积函数图像')
%%%%%%%%%%%%%%%%%%%
是不同的呀!算出Y(i,j)是复数,是不是这个原因?导致程序运行后出现错误:
??? Error using ==> surf
X, Y, Z, and C cannot be complex.
Error in ==> myint2 at 9
surf(w,h,Y)
那这种情况该怎么处理?谢谢了 |