Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function result = mpk(f,x0,y0,h,hcount)
- %Argumenty fce:
- % f - matlab function_handle (f(x,y))
- % x0 - x pocatecni podminky
- % y0 - y pocatecni podminky
- % h - velikost kroku pro x
- % hcount - pocet kroku h
- %Return fce:
- % result - dvouradkova matice bodu xi,yi
- if nargin < 5
- error('Nedostatecny pocet zadanych argumentu')
- end
- if nargin(f) ~= 2
- 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::)')
- end
- if(~isa(f,'function_handle'))
- error('f neni matlabovsky function_handle')
- end
- result = [x0;y0];
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement