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
What are smart mobile devices
Nezavi [6.7K]

portable computing tool

7 0
3 years ago
How to calculate a pid controller
pishuonlain [190]

Answer:

Control by PID1

is a control method often used for servos.

Don't you know what a bondage is? Well, it's a system, capable of reaching and

maintain a setpoint thanks to the measurements it performs.

Imagine, for example, in a car on the highway. You want to drive at 130Km / h

without having to press the accelerator. Your car's cruise control should

by itself maintain this speed. When approaching a slope the system "notices" that for

the same power at the level of the motor, it no longer reaches the 130 km / h setpoint and will add a

little acceleration. Yes but by how much? And how long will it take for the system to

stabilize around the setpoint?

That's the whole servo problem and PID control is one way to solve it!

PID is the most widely used regulator in industry. The idea of ​​this control body is to

intentionally modify the value of the error which remains between the setpoint and the measurement

performed.

For example in the case of a position control the error would be: ε = c (p) - s (p)

In the case of proportional control, the error is virtually amplified by a certain gain

constant that should be determined according to the system.

Setpoint (t) = Kp.ε (t)

What in Laplace gives:

Setpoint (p) = Kp.ε (p)

Explanation:

5 0
3 years ago
Why do arthitects prefer memory dump to be in base 16​
gogolik [260]

Answer:

Memory dump in  base 16​ is human friendly

Explanation:

Hexadecimal numbers are human friendly and hence it is very easy to express the binary number in a more human-friendly as compared to any other base number systems. It is also used to trace errors in the storage

hence, the Architects prefer memory dump to be in base 16​

7 0
2 years ago
ONlY OnE pErcEnT oF pEOpLe CaN sOlvE tHiS!
igomit [66]

Answer:

yeeee

Explanation:

7 0
3 years ago
Read 2 more answers
Purple gang or green gang?
zhuklara [117]

Answer:

Purple?

Explanation:

8 0
2 years ago
Read 2 more answers
Other questions:
  • Being tired has very similar effects on the body as what
    7·1 answer
  • George is only familiar with VGA connector for monitors. What should you tell him are the main differences between VGA and DVI c
    8·1 answer
  • Which osi reference model layer includes all programs on a computer that interact with the network?
    13·1 answer
  • What is a 'balanced' dfd?
    5·1 answer
  • "The fact that we could create and manipulate an Account object without knowing its implementation details is called"
    9·1 answer
  • What option is available on a Host A record to tell the system how long the record should remain in the database after it was cr
    15·1 answer
  • Select the correct answer from each drop-down menu.
    7·2 answers
  • The feature that moves text from the right edge of a paragraph to the beginning of the next line as necessary to fit within the
    12·1 answer
  • Listed here are a few camera angles and their images.
    10·1 answer
  • Which three statements are true of lossless compression?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!