How can I insert legends for every curves for any variable and how can I insert greekk letters in legends..... The MATLAb code is
fid1=fopen('Zeta.txt','w');
fprintf(fid1, ' Gr \t M \t Q \r\n');
fprintf(fid1,'---------------------------------------------------\r\n');
Gr(1)=5;
M(1)=5;
for i= 1:4
for j=1:1001
a(j)=M(j);
R = 2.500;
alpha = pi/4;
K = 0.41;
x1 = M(j)*M(j);
x2 = sin(alpha);
x3 = Gr(i)*x2;
x4 = x1*R;
x5 = x1*x4;
x6 = x3/x4;
x7 = x3/x5;
x8 = 2/x1;
x9 = 1 + x8;
x10 = x9*x1;
x11 = exp(M(j));
x12 = exp(-M(j));
x13 = x11 + x12;
x14 = x11 - x12;
x15 = x13/2;
x16 = x14/2;
x17 = x13 - 2;
x18 = M(j)*x14;
x19 = x17/x18;
x20 = x16/M(j);
x21 = x10*x15;
x22 = x21 - 2;
x23 = x22*x19;
x24 = x7*x23;
x25 = x9*x20;
x26 = x6*x25;
x27 = R*K;
x28 = 2*x1;
x29 = x27/x28;
x30 = x6/3;
x31 = 2*x7;
x32 = x24 - x26 + x29 + x30 + x31;
Q(j) = x32;
fprintf(fid1, '%f\t %f \t %f \r\n', Gr(i), M(j), Q(j));
Gr(i+1)=Gr(i)+10;
M(j+1)=M(j)+0.01;
end
fprintf(fid1,'-----------------------------------------------\r\n');
plot(a,Q,'r--');
%plot(x,z3,'r--')
%%plot(x,y1,'g',x,y2,'b--o',x,y3,'c*')
xlabel('M');
ylabel('Q');
title('Rate of Mass Flow');
%legend ('M=20','M=15','M=10','M=5');
hold on
end
fclose(fid1);
hold on
0 Comments
Sign in to comment.