?
Solved

Can someone advise how to draw a circle in Matlab

Posted on 2009-04-07
5
Medium Priority
?
2,901 Views
Last Modified: 2016-02-10
Please find the attached code

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
set(gca,'FontSize',14) % adjust fontsize
 
 
 
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')

Open in new window

screener.png
0
Comment
Question by:jtiernan2008
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 15

Expert Comment

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

0
 
LVL 15

Accepted Solution

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

Open in new window

0
 
LVL 1

Author Comment

by:jtiernan2008
ID: 24089728
thanks for your response...

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

Error in ==> triangle at 23
H=circle(center,radius,N,'r-');
0
 
LVL 1

Author Comment

by:jtiernan2008
ID: 24089752
ah wait I see I am to download from the link above :)
0
 
LVL 1

Author Closing Comment

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

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Navigation is an important part of web design from a usability perspective. But it is often a pain when it comes to a developer’s perspective. By navigation, it often means menuing. This is less theory and more practical of how to get a specific gro…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question