Plot Circles from Text FIle

I'm using Matlab R2010a. I have a text file that has data on (x,y,radius,fill color intensity, and fill color) of multiple circles in 5 columns respectively. I am required to create an image file with those data in Matlab. However, I have no idea how to do it. Any help would be very appreciated. Thank you in advance.

댓글 수: 1

John Petersen
John Petersen 2012년 7월 31일
Are you asking how to load the file? plot the images? or both? Are x,y the center point of the circles? Fill color intensity and fill color are each just one column wide? How do they translate to color?

댓글을 달려면 로그인하십시오.

답변 (2개)

John Petersen
John Petersen 2012년 7월 31일
편집: John Petersen 2012년 7월 31일

0 개 추천

Once you have imported the data, if x,y are the center coordinates
t=[0:.01:2*pi];
plot(x+r*cos(t), y+r*sin(t),'color',[1 0 0])
will plot circles.
rectangle('Position',[x,y,r,r],'curvature',[1,1],'facecolor','r');
will plot filled circles.
axis 'square'
will change the aspect ratio
Image Analyst
Image Analyst 2012년 7월 31일

0 개 추천

Try using textscan(), cxvread(), or dlmread() to read in the values from the text file. Then use rectangle() (along with hold on) to plot the circles.

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

질문:

2012년 7월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by