Bisection Method in MATLAB

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ม.ค. 2025

ความคิดเห็น • 17

  • @YtPlankmaster123
    @YtPlankmaster123 3 ปีที่แล้ว +4

    Thanks I was stuck with some problem. After this video I was able to fix it :).

  • @zac778
    @zac778 2 ปีที่แล้ว +1

    Can you explain why the error sometimes increases? Generally yes it decreases but if you look at the error column, at 6:35 the estimated error actually goes up and down for a few lines

    • @ChickensBreast
      @ChickensBreast ปีที่แล้ว

      It's not an error column. It's the value f(x) for the different mid-point of intervals

  • @morningshiindi7496
    @morningshiindi7496 2 ปีที่แล้ว +3

    thank you so much was really finding this tough 🙏

  • @FernandoDeekeSasse
    @FernandoDeekeSasse 4 ปีที่แล้ว

    Thanks for the explanation. I will refer this video to my students.

  • @Catalina-wi9kl
    @Catalina-wi9kl 2 ปีที่แล้ว +1

    How can I do it when my function is always positive?

    • @pattonluks
      @pattonluks  2 ปีที่แล้ว +2

      Check your algebra. Remember that you need to start by rearranging the equation to the form f(x) = 0. If this is always positive (or negative), then there is no solution.

  • @fawadalam4717
    @fawadalam4717 ปีที่แล้ว +1

    plz mam i need the code

  • @notofficial632
    @notofficial632 4 ปีที่แล้ว +3

    Mam , can you provide the codes

    • @brianreinhard8841
      @brianreinhard8841 3 ปีที่แล้ว +22

      function [x,e] = bisection (f,a,b,n)
      c = f(a); d = f(b);
      if c*d > 0.0
      error ('Function has ame sign at both endpoints')
      end
      disp(' x y')
      for i = 1:n
      x = (a+b)/2;
      y = f(x);
      disp([ x y])
      if y == 0.0
      a = x;
      b = x;
      break
      end
      if c*y < 0.0
      b = x;
      else
      a = x;
      end
      end
      x = (a+b)/2;
      e = (b-a)/2;
      end

    • @beratkayskran1080
      @beratkayskran1080 3 ปีที่แล้ว +2

      @@brianreinhard8841 youre great mannn

    • @BAPPA_Rawala
      @BAPPA_Rawala 3 ปีที่แล้ว

      @@brianreinhard8841 why is it showing"Not enough input arguments " please tell man I need help seriously 🙏🙏🙏

    • @BAPPA_Rawala
      @BAPPA_Rawala 3 ปีที่แล้ว

      Although I have run the same exact codes in MATLAB......

    • @BAPPA_Rawala
      @BAPPA_Rawala 3 ปีที่แล้ว

      Now it is showing = unrecognised function or variable 'f'

  • @elvesun
    @elvesun 3 ปีที่แล้ว +1

    it doesnt work