% Example 12-3: Maximum viewing angle % Do an initial plot fplot('((x^2+5^2)+(x^2+41^2)-36^2)/(2*sqrt(x^2+5^2)*sqrt(x^2+41^2))', [0 25]) xlabel('x'); ylabel('cos/(\theta)'); pause % Find the minimum [x anglecos] = fminbnd('((x^2+5^2)+(x^2+41^2)-36^2)/(2*sqrt(x^2+5^2)*sqrt(x^2+41^2))', 10, 20) angle = anglecos*180/pi