Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Circles and Line segments

Subject: Circles and Line segments

From: Jacob Teal

Date: 28 Jun, 2012 21:02:18

Message: 1 of 2

Hello all,

I'm having an issue with circles. I need to put a line segment that connects to center of the circles, but my code isn't working out. I'm using the rectangle method, as seen below. So i'm basically asking if anyone can look at my code tell me why I can't just plot the centers ([East North], [East1 North1]). Thanks!

r = 1.5;
theta = linspace(0, 2*pi, 360);


[East North] = lonlat2km(-117.2395833, 32.6658333, -117.1223667, 32.5360667);
[East1 North1] = lonlat2km(-117.1223667, 32.5360667,-117.2395833, 32.6658333);

distance = sqrt((East^2) + (North^2));

X = [East North];
Y = [East1 North1];

hold on


rectangle('Position',[East-r,North-r,2*r,2*r],...
          'Curvature',[1,1],...
         'LineWidth',1,'LineStyle','-')
daspect([1,1,1])

rectangle('Position',[East1-r,North1-r,2*r,2*r],...
          'Curvature',[1,1],...
         'LineWidth',1,'LineStyle','-')
daspect([1,1,1])
plot(East, North)
plot(East1, North1)
plot(Y, X)

hold off

Subject: Circles and Line segments

From: Yash

Date: 30 Jun, 2012 12:36:14

Message: 2 of 2

tried running your file but this line is causing error


[East North] = lonlat2km(-117.2395833, 32.6658333, -117.1223667, 32.5360667);
[East1 North1] = lonlat2km(-117.1223667, 32.5360667,-117.2395833, 32.6658333);

this function isnt availble else

??? Undefined function or method 'lonlat2km' for input arguments of type 'double'.

post that too will run and check

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us