在matlab中怎么进行指数函数的图解比较?

 时间:2026-02-14 17:25:48

1、命令行键入:

% Define the mesh

x = 0:0.16:5;

y = 0:0.16:5; 

[xx,yy] = meshgrid(x,y);

% The plot

zz = xx.^yy-yy.^xx;

h = surf(x,y,zz); 

h.EdgeColor = [0.7 0.7 0.7]; 

view(20,50); 

colormap(hsv); 

title('$z = x^y-y^x$','Interpreter','latex') 

xlabel('x') 

ylabel('y') 

hold on

2、按“Enter”键。

如图1所示。

在matlab中怎么进行指数函数的图解比较?

3、命令行键入:

c = contourc(x,y,zz,[0 0]);

list1Len = c(2,1); 

xContour = [c(1,2:1+list1Len) NaN c(1,3+list1Len:size(c,2))]; 

yContour = [c(2,2:1+list1Len) NaN c(2,3+list1Len:size(c,2))];

% Note that the NAN above prevents the end of the first contour line from being

% connected to the beginning of the second lineline(xContour,yContour,'Color','k');

4、按“Enter”键。

如图2所示。

在matlab中怎么进行指数函数的图解比较?

5、命令行键入:

plot([0:5 2 4],[0:5 4 2],'r.','MarkerSize',25);

6、按“Enter”键。

如图3所示。

在matlab中怎么进行指数函数的图解比较?

7、命令行键入:

e = exp(1); 

plot([e pi],[pi e],'r.','MarkerSize',25); 

plot([e pi],[pi e],'y.','MarkerSize',10); 

text(e,3.3,'(e,pi)','Color','k', ...   'HorizontalAlignment','left','VerticalAlignment','bottom'); 

text(3.3,e,'(pi,e)','Color','k','HorizontalAlignment','left',...   'VerticalAlignment','bottom'); 

hold off;

8、按“Enter”键。

如图4所示。

在matlab中怎么进行指数函数的图解比较?

  • Matlab字符串函数及二维字符串
  • 如何在matlab中使用循环及条件语句?
  • MATLAB文本和字符串创建,连接和转换
  • MATLAB矩阵、集合操作函数介绍
  • MATLAB中假设检验的介绍
  • 热门搜索
    腺样体肥大是怎么引起的 怎么蒸米饭 怎么让孩子爱上学习 脚抽筋怎么办 小米手机怎么刷机 羽毛球用英语怎么说 脱发严重怎么办 龙虾怎么洗 红旗车怎么样 忘记id密码怎么办