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]
3 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]3 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
Assume the existence of a class named window with functions named close and freeresources, both of which accept no parameters an
denis-greek [22]
In your question whereas there is a class named window and it would be like this:

class window {
//code here 
}

Next is there is a function called close and freeresource and it goes like this:

class window{
  function close( ){
   //code here
  }
  function freeresource( ){
  // code here
  }
 public destruct (){
this.close();
this.freeresource();
}

}
The last code function destruct invokes the function close and freeresource. Hope this would help 

7 0
3 years ago
Defeating authentication follows the method–opportunity–motive paradigm.
sashaice [31]

Answer:

Method:- This is related to hackers technique and way of accessing to copy other data. It also includes the skill, knowledge, tools and other things with which to be able to pull off the attack.

Opportunity:- this is related to how a user gives way to access to the hackers. It includes the time, the chance, and access to accomplish the attack.

Motive:- This may relate to the hacker to destroy the reputation of another or for money. It is reason to want to perform this attack against this system

3 0
3 years ago
What are the ASE special certifications?
kykrilka [37]

Answer:

It is The National Institute for Automotive Service Excellence.

Explanation:

8 0
3 years ago
Read 2 more answers
Which devices typically generate computer output ?
Andrews [41]
Monitor , printer , speaker , projector , keyboard etc
6 0
3 years ago
Read 2 more answers
with the _______ network topology, reliability is the major advantage while high cost is the disadvantage.
Nady [450]
It's what the chat says, Its hybrid
6 0
3 years ago
Read 2 more answers
Other questions:
  • What does "Forward" in emails do?​
    7·1 answer
  • Consists of a drive letter (preceded by a drive name when necessary) and colon, to identify the storage device, and one or more
    5·1 answer
  • Refer to the exhibit. the gigabit interfaces on both routers have been configured with subinterface numbers that match the vlan
    11·1 answer
  • Any parameter that receives a value and also sends a value outside the function must be declared as a reference parameter.
    8·1 answer
  • NEED HELP NOW 25 POINTS WILL MARK BRAINLIEST!!!!!!!
    8·1 answer
  • ____ are programs that run independently and travel between computers and across networks.
    7·1 answer
  • Which type of microphone uses two metal plates?
    7·1 answer
  • HELPPPP KOKICHI IS OUT TO KILL ME
    11·1 answer
  • Which class members should be declared as public?
    12·1 answer
  • Hey everyone. I am so bored
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!