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

    如何創建簡單的圖和畫圓圈注釋

    定義和繪制函數 f(x) 和 g(x)。

    東西/原料

    • matlab
    • 電腦

    方式/步調

    1. 1

      號令行鍵入:

      x = -3.0:0.01:3.0;

      %界說x的規模,起點-3,終點3,步進維0.01。

    2. 2

      號令行鍵入:

      f = x.^2;

      %界說f的規模。

    3. 3

      號令行鍵入:

      g = 5*sin(x) + 5;

      %界說了g的規模。

    4. 4

      號令行鍵入:

      figure

      plot(x,f)

      %繪圖。

    5. 5

      號令行鍵入:

      hold on

      %連結圖形

    6. 6

      號令行鍵入:

      plot(x,g)

      hold off

      %繪圖。

    7. 7

      號令行鍵入:

      elps = annotation('ellipse',[.84 .68 .05 .05])

      %在圖中添加一個圓圈,以凸起顯示 f(x) 等于 g(x) 的位置。要建立圓圈,請利用 'ellipse' 選項作為注釋類型。

    8. 8

      號令行鍵入:

      elps.Color = [0 0.5 0.5];

      %界說elps的顏色。

      END
    • 發表于 2020-04-10 17:00
    • 閱讀 ( 750 )
    • 分類:其他類型

    相關問題

    0 條評論

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