Insert particular number on the figure using loop
Afficher commentaires plus anciens

I am trying to insert a number for each curve in my plot, the M matrix is 1 x 100, and doing for each is tedious and non efficient method.
here is part of my code where M is limited to 1x3 matrix:
B=0:.001:pi/2;
Y=1;
M=[1 2 3];
for j=1:1:length(M)
D=zeros;
for i=1:1:length(B)
D(i)=atan(( 2*cot(B(i))*(M(j)^2*sin(B(i))^2-1) )/( 2+M(j)^2*(Y+cos(2*B(i))) ));
end
figure(1)
hold on
plot(rad2deg(D),rad2deg(B))
end
B_max=zeros(1,length(M));
D_max=zeros(1,length(M));
for k=1:1:length(M)
S='M(k)';
B_max(k)=asin(sqrt(((Y+1)/(4*Y))-(1/(Y*M(k)^2))*(1-sqrt((Y+1)*((1+((Y-1)*M(k)^2/2))+((Y+1)*M(k)^4/16))))));
D_max(k)=atan((2*cot(B_max(k))*(M(k)^2*sin(B_max(k))^2-1))/(2+M(k)^2*(Y+cos(2*B_max(k))) ));
text(rad2deg(D_max(k)),rad2deg(B_max(k)),S(1))
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!
