x
Solved

# Can someone advise how to draw a circle in Matlab

Posted on 2009-04-07
Medium Priority
2,949 Views

I want to draw a circle of 1 meter radius at f1 and a 11 meter at f2

I have tried to search in the help files but can't figure it out...

your help would be really appreciated.
``````clear % all variables
figure(1), hold off

Line1X=[-10,10];
Line1Y=[-10,-10];
Line2X=[10,0];
Line2Y=[-10,10];
Line3X=[-10,0];
Line3Y=[-10,10];
line(Line1X,Line1Y)
line(Line2X,Line2Y)
line(Line3X,Line3Y)
text(-10,-10,'\leftarrow f1 (x1,y1)','VerticalAlignment','middle','HorizontalAlignment','left')
text(10,-10,'\leftarrow f2 (x2,y2)','VerticalAlignment','middle','HorizontalAlignment','left')
text(0,10,'\leftarrow f3 (x3,y3)','VerticalAlignment','middle','HorizontalAlignment','left')
``````
screener.png
0
Question by:jtiernan2008
• 3
• 2

LVL 15

Expert Comment

ID: 24089457
Use CIRCLE function from Matlab file exchange:
http://www.mathworks.com/matlabcentral/fileexchange/2876

0

LVL 15

Accepted Solution

yuk99 earned 2000 total points
ID: 24089518
This is an example how to use CIRCLE function:
``````center=[0,0];
N=100; % number of points (circle resolution)
``````
0

LVL 1

Author Comment

ID: 24089728

I get an error
??? Undefined function or method 'circle' for input arguments of type 'double'.

Error in ==> triangle at 23
0

LVL 1

Author Comment

ID: 24089752
0

LVL 1

Author Closing Comment

ID: 31567605
thanks a million
that's really useful
0

## Featured Post

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.