Forward Difference

//Forward Difference
x=input("Enter value of x as row matrix:")
y=input("Enter value of y as row matrix:")
xg=input("Enter xg at which we want to interpolate:")
n=length(x)
h=x(2)-x(1)
u=(xg-x(1))/h
disp("Forward difference table is:")
for i=1:n-1
    disp(diff(y,i))
end
yg=y(1)
p=u
for i=1:n-1
    d=diff(y,i)
    yg=yg+p*d(1)
    p=p*((u-i)/(i+1))
end
disp(yg,"The interpolation by forward difference table is :")

//Outputs
-->exec('D:\Scilab\Scilab without outputs\Forward difference.sce', -1)
Enter value of x as row matrix:[10 20 30 40 50]
Enter value of y as row matrix:[45 65 80 92 100]
Enter xg at which we want to interpolate:17

 Forward difference table is:  

    20.    15.    12.    8.

  - 5.  - 3.  - 4.

    2.  - 1.

  - 3.

 The interpolation by forward difference table is :  

    59.694488

41 comments:

  1. thank you sooooo much
    it was very helpful

    ReplyDelete
    Replies
    1. assignment chap liya aur kyahi chahiye

      Delete
  2. Replies
    1. just like my dick after looking at your mother

      Delete
  3. You helped me a lot. Thankyou very much.😘

    ReplyDelete
  4. bro do it without using diff operator

    ReplyDelete
  5. ohhhhhhh yeahhh !

    ReplyDelete
  6. Stop right there you criminal scum !. Anirban is watching all of you

    ReplyDelete
  7. students of IIIT Kalyani students stop copying from this website or else you will recive Zero marking

    ReplyDelete
  8. Dont copy today's AL lab assignment from here IIIT Kalyani student's because I am copying this one :) Search another one

    ReplyDelete
    Replies
    1. See you next year too

      Delete
    2. bhosdike bacho ki zindagi barbad krna band kr

      Delete
    3. Join the theory link

      Delete
    4. we called you many times

      Delete
    5. No we will not take any viva now so go sleep

      Delete
    6. Attendance link will close in 10 seconds

      Delete
    7. I have been coding since very long

      Delete
    8. Actually I forgot

      Delete
    9. aaja tujhe chaand p l chlu

      Delete
    10. No no no no actually that is toh not possible na

      Delete
  9. and yash ,pax and ali yaha se mat chapna its a trap

    ReplyDelete
  10. Newton backward nhi hora tha kya noobde

    ReplyDelete
  11. real id se aao ghatiya valo player

    ReplyDelete
  12. You peepul this is cheating, I bhill mark you peepul zero

    ReplyDelete
  13. Immediate action bhill be taken against all of you

    ReplyDelete
  14. I am Soham anonymus is also my insta id meri shaktio ka galat istamaal ho rha hai reg no.601 currently 4th sem aniraban's data science student

    ReplyDelete
  15. WHAT IS THIS PLACE??

    ReplyDelete
  16. mccian aagye code chapnee

    ReplyDelete
  17. le reena mam,i will not give u marks if u copy from this website

    ReplyDelete
  18. Dr. Ashish K Badika is an Arthritis Doctor in Indore with have 3 years of advanced training in Rheumatology and Clinical Immunology including 2 years Post Doctoral.

    ReplyDelete