# Multiple curves in a single graph

조회 수: 2(최근 30일)
Himanshu SINGLA 2018년 5월 22일
답변: VBBV 2021년 10월 25일
In a program i am plotting graph between two variables.
By changing Value of ''AOM2'' to 0,10,25,50 ,I will get different plots. I want to draw all those curves in a single figure.
I already tried many things like ''hold on'' and other commands also but nothing is working.
if true
S1=[];
AOM2=25;%(ohm)
AOG=5; %omega
AOMG=AOM2./AOG; %OHM UPON OMEGA
AOMN=1+ (AOMG).^2 ; %1+OHM SQUARE UPON OMEGA SQUARE
C4S=2*1i.*AOMG;
ATT=27;%(T0=300K)
ALM=3.17;% LAMBDA
AMU=1.639;%MU
RO=1.74; %RHO
AT2=.005; %TAU NOT
ACE=23.61; %C_E
AK=0.492; %K
ALF1=0.05;%ALPHA_T
GAMA=1.13849;
AXI=2; %axie
AZT0=3.688;%ZETA NOT
ZTA=.01;%ZETA
AJ=1.753;%J
AT3=.05;%TAU
AKS=1;%(small k wave number)
AB=0.05;%a
OGB=0.05;%b
AT=0.05;%TAU
ALF2=0.05;%ALPHA_C=0.05
ET=1i;
ATMS=AT2+(ET./AOG);% (tau power m)
ATNS=AT3+(ET./AOG);%(tau power n)
C1S=(ALM+2.*AMU)/RO;
C2S=AMU./RO;
%C3S=(AZT0/(RO*AJ))+D0/(RO*AJ*AKS);
%ATMS=AT2*ONE+(ET/OG);
%ATNS=AT3*ONE+(ET/OG);
ABT1=(3.*ALM+2.*AMU)*ALF1;%beta 1
ABT2=(3.*ALM+2.*AMU)*ALF2;%beta 2
ABN=(ABT1*ATT)/(RO*ACE);%
ABT1B=ABT1/RO;%beta 1 bar
ABT2B=ABT2/RO; % beta 2 bar
GAMAB=GAMA./(RO*AJ*AKS);%gamma bar
AXIB=AXI./(RO*AJ*AKS); % exie bar
AZTB=ZTA./(RO*AJ*AKS); % zeta bar
ABN=(ABT1*ATT)/(RO*ACE);% epsilon
ABN0=(OGB*ATT)/(RO*ACE); % epsilon not
ABN1=(AXI*ATT)/(RO*ACE);%epsilon star
B0=(-AOMN^2-C4S^2);
Y=[B0 B1 B2 B3 B4 B5];
R=roots(Y);
S=real(sqrt(R));
S1=[S1 S];
end
figure(1)
end
Kindly Help me with this.

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

### 답변(2개)

KSSV 2018년 5월 22일
USe :
##### 댓글 수: 7표시숨기기 이전 댓글 수: 6
Himanshu SINGLA 2018년 5월 30일
Sir, I tried this
if true
end
but in figure, all the curves show the same marker (last marker style star).
I am plotting graph between AD and first root of 5 degree polynomial by taking different values of AOM=0,10,50,100.
I also tried following
if true
%hold on
% hold on
% hold on
% hold on end
but in this case also figure shows same marker style in all curves.

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

VBBV 2021년 10월 25일
O = [0,10,50,100] ;
figure
hold on
for i = 1:length(O)
S1=[];
AOM2=O(i);%(ohm)
AOG=5; %omega
AOMG=AOM2./AOG; %OHM UPON OMEGA
AOMN=1+ (AOMG).^2 ; %1+OHM SQUARE UPON OMEGA SQUARE
C4S=2*1i.*AOMG;
ATT=27;%(T0=300K)
ALM=3.17;% LAMBDA
AMU=1.639;%MU
RO=1.74; %RHO
AT2=.005; %TAU NOT
ACE=23.61; %C_E
AK=0.492; %K
ALF1=0.05;%ALPHA_T
GAMA=1.13849;
AXI=2; %axie
AZT0=3.688;%ZETA NOT
ZTA=.01;%ZETA
AJ=1.753;%J
AT3=.05;%TAU
AKS=1;%(small k wave number)
AB=0.05;%a
OGB=0.05;%b
AT=0.05;%TAU
ALF2=0.05;%ALPHA_C=0.05
ET=1i;
ATMS=AT2+(ET./AOG);% (tau power m)
ATNS=AT3+(ET./AOG);%(tau power n)
C1S=(ALM+2.*AMU)/RO;
C2S=AMU./RO;
%C3S=(AZT0/(RO*AJ))+D0/(RO*AJ*AKS);
%ATMS=AT2*ONE+(ET/OG);
%ATNS=AT3*ONE+(ET/OG);
ABT1=(3.*ALM+2.*AMU)*ALF1;%beta 1
ABT2=(3.*ALM+2.*AMU)*ALF2;%beta 2
ABN=(ABT1*ATT)/(RO*ACE);%
ABT1B=ABT1/RO;%beta 1 bar
ABT2B=ABT2/RO; % beta 2 bar
GAMAB=GAMA./(RO*AJ*AKS);%gamma bar
AXIB=AXI./(RO*AJ*AKS); % exie bar
AZTB=ZTA./(RO*AJ*AKS); % zeta bar
ABN=(ABT1*ATT)/(RO*ACE);% epsilon
ABN0=(OGB*ATT)/(RO*ACE); % epsilon not
ABN1=(AXI*ATT)/(RO*ACE);%epsilon star
B0=(-AOMN^2-C4S^2);
Y=[B0 B1 B2 B3 B4 B5];
R=roots(Y);
S=real(sqrt(R));
S1=[S1 S];
end
end
legend
Which version of Matlab are you using ?

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

### Community Treasure Hunt

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

Start Hunting!

Translated by