title: Delete kinks and smooth curves
body: <p>I have some data which when plotted looks like the one shown in left on the picture attached.
  It has some kinks which I wish to delete and smooth-en to get a nice curve [shown on right].</p>
  
  <p>Presently I manually delete the kinks and interpolate the deleted part by polynomial of high order [say 9]. Then I repopulate the deleted fragment and re-draw the curve.
  This takes a long time and I have quite a number of files to process.</p>
  
  <p>Could you folks suggest an efficient way to do this ?
  [in MATLAB or some other way]<img src="https://i.stack.imgur.com/t4P6K.jpg" alt="enter image description here"></p>
  
  <p>Thanks a lot !!</p>
  
  <p>P.S.: Added one more plot for clarification above
  <img src="https://i.stack.imgur.com/slma5.jpg" alt="Second case"></p>