Advertisement
Savelyev_Vyacheslav

task_4_2

Nov 17th, 2021
1,168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.31 KB | None | 0 0
  1. fun=@(x) ( atan(x) - 2 - (x+3).^3);
  2. x1 = fminsearch(fun, -100) %
  3.  
  4. funABS = @(x) (abs( atan(x) - 2 - (x+3).^3));
  5. x0 = fminsearch(funABS, -100);
  6.  
  7. start = fix(x0) - 10
  8. finish = fix(x0) + 10
  9. x = (start:0.01:finish)';
  10. yyy = fun(x)
  11. fun(x0)
  12.  
  13. figure(1)
  14. hold('on');
  15. plot(x,yyy,'r*');
  16. plot(x0,fun(x0), 'b*')
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement