Plotting multiple graphs but only a graph is shown
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Annotations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!