Program for computing derivative

edited January 2011 in Science & Tech
Hey everyone,

I have to write a program to compute an approximate value for the derivative of a function using the finite-difference formula f'(x)=[f(x+h)-f(x)]/h. I have to test the program for tan(x)=1. Then, I have to determine the error by comparing with the square of the built-in function sec(x). Then, I have to plot the magnitude of the error as a function of h, for h=10^(-k), k=0,...,16. Also, I should use the log scale for h and for the magnitude of error.

Can anyone help me with this problem or at least part of this problem. Any help will be appreciated. Thank you very much.

Comments

  • primesuspectprimesuspect Beepin n' Boopin Detroit, MI Icrontian
    edited January 2011
    Dude. STOP posting "Do my homework" threads in the "Icrontic stuff" forum. I moved your threads to the Matlab help.

    We're not here to do your homework for you, by the way.
  • edited January 2011
    Primesuspect- If you don't want to help me, that's fine. Nobody is compelling you to do so. But please don't post any of your nonsense because, quite frankly, I don't have the time or energy to deal with any nonsense. Thank you.
  • shwaipshwaip bluffin' with my muffin Icrontian
    edited January 2011
    You are aware that prime owns this site.

    You should also be aware that any of the 4 people on this site who can help you are RL friends with him.

    He is also correct. We are not here to do your homework.
  • primesuspectprimesuspect Beepin n' Boopin Detroit, MI Icrontian
    edited January 2011
    Good night, sweet prince.
  • primesuspectprimesuspect Beepin n' Boopin Detroit, MI Icrontian
    edited January 2011
    I got this on Facebook today: :D
    I can't believe it. You outsmarted me. I had no idea that you would realize that a-team and a-team2 are one and the same.

    Now that I boosted your ego, I will have to rain on your parade now. I was just being sarcastic (oh poor man did I hurt your feelings). I created the a-team2 account to respond to the thread. Lo and behold, you closed the thread also. You knew that I would create another account and respond to the thread, but you didn't want to continue any argument with me because you knew you were in the wrong. So, I decided to send you a message, but you had already blocked me by then. I knew you were a loser, but I didn't realize you were that much of a loser. Because I am a person with a life outside the computer, I guess I expected you to be the same to at least a slight extent. But, I was wrong. I knew that you would see that a-team and a-team2 were the same person but, as I said, I didn't realize that you were that much of a loser to the point that you are always on the computer.

    If I wanted to, I could easily create another Icrontic Forums account where you won't be able to guess who I am, but, unlike you, I have a life. I hate to rain on your parade again, but the e-mails I used were already created a while back. I didn't create them just to get on your forum. So, sorry to burst your bubble.

    So, my message to you is: Nice try! You thought you got rid of me, but I found you on facebook and got a hold of you. Anyway, it's completely fine that you blocked me. I will get my help elsewhere. I don't need to be on a forum that is run by a geek who lives in his parents' basement and trolls around and start arguments with people.

    My advice to you is to get out more. You will make a lot more friends that way than by posting up the various ways to contact you on your incrontic forums website. And I hate to break it to you, but those 555 friends on facebook are only "friends" with you because they want programming help. So, don't fool yourself into thinking that they are actually your friends. And go ahead, block me on facebook. Since you don't really have anything to live for, I am sure you will get a kick out of blocking me on here as well.
  • primesuspectprimesuspect Beepin n' Boopin Detroit, MI Icrontian
    edited January 2011
    If he had spent as much time on his homework as he did on that reply, he might know Matlab by now.
  • BuddyJBuddyJ Dept. of Propaganda OKC Icrontian
    edited January 2011
    MassFacepalm.jpg
  • KwitkoKwitko Sheriff of Banning (Retired) By the thing near the stuff Icrontian
    edited January 2011
    he mad?
  • ThraxThrax 🐌 Austin, TX Icrontian
    edited January 2011
    Oh, how cute. An Internet thug using the ol' "parents' basement" argument.
  • kryystkryyst Ontario, Canada
    edited January 2011
    I have to give the guy one piece of credit, the message is actually decipherable. It wasn't one long stream of elite speak. It's nice to see a better form of troll from time to time.
  • BuddyJBuddyJ Dept. of Propaganda OKC Icrontian
    edited January 2011
    Oh noes, the trolls are evolving!
  • LincLinc Owner Detroit Icrontian
    edited January 2011
    If he had spent as much time on his homework as he did on that reply, he might know Matlab by now.
    Nearly snorted my soda.

    I found this lovely discussion because I have an email in my inbox from said user innocently asking what EVER could he have possibly done to get banned? :rolleyes:
This discussion has been closed.