Question

Let the mathematical function flu) be defined as: f(x)-exp-0.5x)cos(5x) - 0.5 .x>0 Write a Matlab function called Newton1 thaPlease follow the instructions without using other solutions. Thank you in advance

0 0
Add a comment Improve this question Transcribed image text
Answer #1

function [x f k]=Newton1(x0)

k=0;
% find intial values
xk=x0-(exp(-0.5*x0)*cos(5*x0)-0.5)/(-5*exp(-0.5*x0)*sin(5*x0)-0.5*exp(-0.5*x0)*cos(5*x0))

while abs(xk-x0)>5*eps % while loop toitertations
  

x0=xk;
  
xk=x0-(exp(-0.5*x0)*cos(5*x0)-0.5)/(-5*exp(-0.5*x0)*sin(5*x0)-0.5*exp(-0.5*x0)*cos(5*x0))


  
  
if k>10000
disp('Warning,Iteration diverged')
return
end
k=k+1
  
end
x0=xk
f=(exp(-0.5*x0)*cos(5*x0)-0.5)
x=xk

end

  

MATLAB R2015a HOME EDITOR Find Files Run Section compare ▼ Vİ Print Go To ▼ Comment 96骝 New Open Save Breakpoints Run Run anMATLAB R2015a HOME PLOTS EDITOR Find Files Run Section compare ▼ Vİ Print Go To ▼ Comment a New Open Save Breakpoints Run Ru

Add a comment
Know the answer?
Add Answer to:
Let the mathematical function flu) be defined as: f(x)-exp-0.5x)cos(5x) - 0.5 .x>0 Write a Matlab...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT