- #1
charan1
- 41
- 0
Homework Statement
The distance to the horizon increases as you climb a mountain:
d=sqrt(2rh+h^2)
d=distance to the horizon
r=radius's
h=height of hill
solve for Earth's and Mar's radius
Earths radius Feet: 20924640
Mars radius feet: 11132880
for heights from 0ft-10,000ft
The Attempt at a Solution
This is what I did but I keep getting an error
>> R=[20924640, 11132880]
R =
20924640 11132880
>> H=0:1:10000
>> [r,h]=meshgrid(R,H)
>> d=sqrt((2*r.*h.)+(h.^2))
? d=sqrt((2*r.*h.)+(h.^2))
|
Error: Unbalanced or unexpected parenthesis or bracket.
>> d=sqrt(2*r.*h.+h.^2)
? d=sqrt(2*r.*h.+h.^2)
|
Error: Unexpected MATLAB operator.
I'm not exactly sure what the problem is, please help!