• <noscript id="ecgc0"><kbd id="ecgc0"></kbd></noscript>
    <menu id="ecgc0"></menu>
  • <tt id="ecgc0"></tt>

    解不等式的圖解法

    這個例子展示了一個有趣的圖形化的方法來找出e^pi是否大于pi^e。

    東西/原料

    • matlab軟件
    • 電腦

    方式/步調

    1. 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);


      % Set the properties of the plot

      h.EdgeColor = [0.7 0.7 0.7];

      view(20,50);

      colormap(hsv);

      title('z = x^y-y^x');

      xlabel('x');

      ylabel('y');

      hold on;

    2. 2

      按“Enter”鍵。

      如圖1所示。

    3. 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 line

      line(xContour,yContour,'Color','k');

    4. 4

      按“Enter”鍵。

      如圖2所示。

    5. 5

      號令行鍵入:

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

    6. 6

      按“Enter”鍵。

      如圖3所示。

    7. 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. 8

      按“Enter”鍵。

      如圖4所示。

    9. 9

      號令行鍵入:

      e = exp(1);

      e^pi

      pi^e

    10. 10

      按“Enter”鍵。

      如圖5所示。

      END
    原作者:matlab教程舉報
    • 發表于 2020-02-13 20:00
    • 閱讀 ( 1409 )
    • 分類:其他類型

    你可能感興趣的文章

    相關問題

    0 條評論

    請先 登錄 后評論
    聯系我們:uytrv@hotmail.com 問答工具
  • <noscript id="ecgc0"><kbd id="ecgc0"></kbd></noscript>
    <menu id="ecgc0"></menu>
  • <tt id="ecgc0"></tt>
    久久久久精品国产麻豆