1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
OLEGan [10]
4 years ago
5

The geographic coordinate system is used to represent any location on Earth as a combination of latitude and longitude values. T

hese values are angles that can be written in the decimal degrees (DD) form or the degree, minutes, seconds (DMS) form just like time. For example, 24.5° is equivalent to 24°30'00''. Write a MATLAB script that will prompt the user for an angle in DD form and will print in sentence format the same angle in DMS form. The script should error-check for invalid user input. The angle conversion is to be done by calling a separate function in the script.
Computers and Technology
1 answer:
Pachacha [2.7K]4 years ago
8 0

Answer:

Here is the script:  

function dd = functionDMS(dd)  

prompt= 'Enter angle in DD form ';

dd = input(prompt)

while (~checknum(dd))

if ~checknum(dd)

error('Enter valid input ');

end

dd = input(prompt)

end  

degrees = int(dd)

minutes = int(dd - degrees)

seconds = ( dd - degrees - minutes / 60 ) * 3600  

print degrees

print minutes

print seconds

print dd

Explanation:

The script prompts the user to enter an angle in decimal degree (DD) form. Next it stores that input in dd. The while loop condition checks that input is in valid form. If the input is not valid then it displays the message: Enter valid input. If the input is valid then the program converts the input dd into degrees, minutes and seconds form. In order to compute degrees the whole number part of input value dd is used. In order to compute the minutes, the value of degrees is subtracted from value of dd. The other way is to multiply remaining decimal by 60 and then use whole number part of the answer as minutes. In order to compute seconds subtract dd , degrees and minutes values and divide the answer by 60 and multiply the entire result with 3600. At the end the values of degrees minutes and seconds are printed. In MATLAB there is also a function used to convert decimal degrees to degrees minutes and seconds representation. This function is degrees2dms.

Another method to convert dd into dms is:

data = "Enter value of dd"

dd = input(data)

degrees = fix(dd);

minutes = dd - degrees;

seconds = (dd-degrees-minutes/60) *3600;

You might be interested in
Cloud architects have been largely replaced by ScrumMasters.<br><br> True<br><br> False
Kitty [74]
True much larger than scrum masters
6 0
3 years ago
Read 2 more answers
What is up what everbody up to
andriy [413]

Answer: Eating chicken. drinking cool aid, and playing basketball

Explanation: look at my skin color and u will understand

5 0
3 years ago
Read 2 more answers
"the master boot record (mbr) method of partitioning hard drives is limited to what maximum size of drives
Vaselesa [24]
The answer is <span>2TB.  T</span>he master boot record (mbr) method of partitioning hard drives is limited to  2TB.  <span>The </span>Master Boot Record<span> (</span>MBR<span>) is the information in the first </span>sector<span> of any hard disk that identifies how and where an OS is located, so that it can be </span>boot<span> (loaded) into the computer's main storage or RAM.</span>
6 0
4 years ago
A runtime error is usually the result of:
harina [27]
It is the Logical error/
so ur answer is logical error
8 0
3 years ago
Suppose you are given a text file. Design a Python3 program to encrypt/decrypt that text file as follows:
Allushta [10]

Answer:

Explanation:

Please find attachment for the Python program

Download docx
7 0
3 years ago
Other questions:
  • Which of these statements is true? Steve Jobs invented the mouse as an input device. Bill Gates invented the mouse as an input d
    6·1 answer
  • Which is a good guideline to follow when choosing a background for your slides?. . A. Use a different background for each slide.
    8·1 answer
  • An ____ is a collection of tools, features, and interfaces that enables users to add, update, manage, access, and analyze the co
    10·1 answer
  • Given the following while() loop, which statement is true assuming A,B,C,D are int variables and A &gt; B? while ( ( A &gt;= B)
    8·1 answer
  • ITS A VOTE I NEED HELP
    12·1 answer
  • Two time series techniques that are appropriate when the data display a strong upward or downward trend are ___________ and ____
    14·1 answer
  • Clarice is an architect who is involved in design work on a restaurant in a building that used to be part of the city’s water wo
    8·1 answer
  • This feature automatically creates tables of contents.
    5·1 answer
  • Any correct answers will be helpful.
    13·1 answer
  • Will social media lose its relevance?​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!