Watch this Author's files
What is lat is 0?
alt = p./cos(lat)-N;
How do you handle the exception with div 0 ?
R.
Contact us at files@mathworks.com