PROGRAM:FORMOM.M %calls functions to calculate forces and moments % uses the functions dragf and infc and the %matrix mask [drag,trp,md]=dragf(vx,H,yc*L0); %multiply by mask matrix drag=drag.*mask; md=md.*mask; [inf im]=infc(ax,H,yc*L0,trp); %multiply by mask matrix inf=inf.*mask; im=im.*mask;