Plotting multiple graphs but only a graph is shown
1 次查看(过去 30 天)
显示 更早的评论
I tried to create circles with different radii in one figure. I have put the data of the radii in an array and try to plot the curves. However, only the circle with largest radius shown. I have checked the array a(i,1) is not zero at all. In case the file 'numberden' is needed, I have attached the file here.
clear
clc
clf
R_MAX=sqrt(3)*2*50;
mr=0.025;
dr=(R_MAX-mr)/1000;
filename = 'numberden0.txt';
A=importdata(filename);
ei=A(:,1);
ej=A(:,2);
i=0;
a=zeros(1000,1);
for i=1:1:1000
if (ei(i)~=0)
a(i,1)=ej(i);
elseif (ei(i)==0)
a(i,1)=0;
end
end
a;
theta=linspace(0,2*pi,1000);
for j=1:1:1000
x=a(i,1)*sin(theta);
y=a(i,1)*cos(theta);
hold on
scatter(x,y,'.')
hold off
end
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!