Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have to code a function in matlab (F1) whose values range from 0.740261423849103 to some where around 0.95. Then there is another function (F2) which is usually the square of F1. Is there any way I can replace F2 [ which is F1^2] by a linear form such as K*F1 so that F2 approximates F1 utilizing the fact that F1 lies between 0.74 to 0.95? If I need to put in different values of K for different ranges of F1 that would also be ok. I need to approximate few other complex expressions by simpler linear ones so is there any method I can follow to determine what would be the best approximation? As I mentioned, it would be feasible for me to use different values of K for different ranges of F1.

share|cite|improve this question

You can do this with a piecewise linear function.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.