Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

map.geodesy.isDegree

True if input matches'degree' and false if 'radian'

Syntax

tf = map.geodesy.isDegree(angleUnit)

Description

example

tf = map.geodesy.isDegree(angleUnit) returns true if angleUnit is a partial match for 'degree' (or 'degrees') and false if angleUnit is a partial match for 'radian' (or 'radians'). If angleUnit matches neither 'degrees' or 'radians', map.geodesy.isDegree returns an error.

Examples

collapse all

Create a function to calculate a cosine. In the function, use map.geodesy.isDegree to check the validity of the inputs.

function y = cosine(x, angleUnit)
% X can be in either degrees or radians
 
if map.geodesy.isDegree(angleUnit)
    y = cosd(x);
else
    y = cos(x);
end

Input Arguments

collapse all

Angle unit value, specified as 'degree' or 'radian'.

Data Types: char

Output Arguments

collapse all

True/false flag indicating if a match was found, returned as a logical scalar.

Introduced in R2013a

Was this topic helpful?