%PDF- %PDF-
Direktori : /data/down/eBOOKS/ebooks/Matlab a Simulink/Matlab Pro Lamy/ |
Current File : //data/down/eBOOKS///ebooks/Matlab a Simulink/Matlab Pro Lamy/PocetDlazdic.m |
function [cele, orez]=PocetDlazdic(x_mist,y_mist,x_dlazd,y_dlazd) % kolik ma byt celych full_countx = floor(x_mist/x_dlazd); full_county = floor(y_mist/y_dlazd); cele = full_countx*full_county; % kolik ma byt orezanych cripled_x = 0; cripled_y = 0; if rem(x_mist,x_dlazd) > 0 cripled_x = full_countx; end if rem(y_mist,y_dlazd) > 0 cripled_y = full_county; end if cripled_x > 0 if cripled_y > 0 orez = cripled_x + cripled_y + 1; else orez = cripled_x; end elseif cripled_y > 0 if cripled_x > 0 orez = cripled_x + cripled_y + 1; else orez = cripled_y; end else orez = 0; end end % vola se to napriklad jako : [a, b] = PocetDlazdic(20, 20, 1, 1) % dufam ze chapes. Ked nie najdi si funkcie v helpe aby si to vedel potom vysvetlit