Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The distance to the horizon increases as you climb a hill. The distance can be c

ID: 3686899 • Letter: T

Question

The distance to the horizon increases as you climb a hill. The distance can be computed in the following expression: d = squareroot 2rh + h^2 Where d = distance to horizon, r = radius of the planets, and h = height of the hill. Create a Matlab script to find the distance in miles to the horizon on: for hills from 500 to 10, 000 ft in increments of 500ft. Programming Requirements: The calculation must be in a loop (either for or while). Use correct units in the calculation. Display the results with proper captions.

Explanation / Answer

functionoutput = distance(h,R)

% This function calculates the distance to the horizon from thetop of a

%hill or mountain.

%It requires two inputs, the height of the hill and the radius

% of the planetary body

% Either or both of the inputs can be scalars or matrices

[ Radius, height] = meshgrid(R,h);

output = sqrt(2.*Radius.*height + height.^2);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote