Error while using the circlem function

4 views (last 30 days)
Ojaswita
Ojaswita on 22 May 2015
Commented: Ojaswita on 5 Jun 2015
I am trying to draw a circle on a map using the circlem function, but I am getting the following error:
??? Undefined function or method 'earthRadius' for input arguments of type 'char'.
Error in ==> circlem at 95 [circlelat,circlelon] = scircle1(lat,lon,radius,[],earthRadius(units));
Error in ==> mapexample at 8 q = circlem(24.65,25.91,150, 'facecolor', 'red')
Kindly help me resolve the issue.

Answers (1)

Geoff Hayes
Geoff Hayes on 22 May 2015
Ojaswita - the circlem function (Chad Greene's FEX submission found here) makes use of the Mapping Toolbox which the earthRadius function is a part of. The error message
??? Undefined function or method 'earthRadius' for input arguments of type 'char'.
is telling you that either you don't have this function or it is not within the MATLAB search path. At the very least, you will need this toolbox, so in the Command Window, type
ver
to see your version of MATLAB and all installed products. Do you see the Mapping Toolbox in this list? If not, then you will need to purchase this software or find an alternative to the earthRadius function.
  5 Comments
Geoff Hayes
Geoff Hayes on 4 Jun 2015
What are you replacing the earthRadius with? Have you tried stepping through the code (using the debugger) to figure out what is happening?
Ojaswita
Ojaswita on 5 Jun 2015
I am replacing it with the radius of the earth = 6371000. I cant find the error in my small piece of code. Would appreciate help. Here is my code:
figure
worldmap 'botswana'
axis off
geoshow('landareas.shp','FaceColor',[0.5 0.7 0.5])
geoshow('worldcities.shp','Marker','.','Color','red', 'MarkerSize', 25)
q = circlem(24.65,25.91,500, 'facecolor', 'red')

Sign in to comment.

Categories

Find more on Data Import and Analysis in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!