Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. function result = mpk(f,x0,y0,h,hcount)
  2.  
  3. %Argumenty fce:
  4. % f - matlab function_handle (f(x,y))
  5. % x0 - x pocatecni podminky
  6. % y0 - y pocatecni podminky
  7. % h - velikost kroku pro x
  8. % hcount - pocet kroku h
  9. %Return fce:
  10. % result - dvouradkova matice bodu xi,yi
  11.  
  12. if nargin < 5
  13. error('Nedostatecny pocet zadanych argumentu')
  14. end
  15.  
  16. if nargin(f) ~= 2
  17. error('f neni fce dvou promennych (i kdyz se tam nejaka promenna nevyskytuje, specifikujte ji jako argument, napr. pri reseni dy/dx = y^2 je ::f=@(x,y) y^2::)')
  18. end
  19.  
  20. if(~isa(f,'function_handle'))
  21. error('f neni matlabovsky function_handle')
  22. end
  23.  
  24. result = [x0;y0];
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement