more lines on plot

I write a code and draw plot,now I want to change one value in code to draw more line on same plot.
can I anybody tell , how to write this code??

댓글 수: 1

KSSV
KSSV 2020년 6월 10일
What code you wrote? What change you want? Show us your expectations.

답변 (1개)

KSSV
KSSV 2020년 6월 10일
편집: KSSV 2020년 6월 10일

0 개 추천

T = [0.75 1. 1.25 ]
for i = 1:length(T)
t = T(i)
p(1)=1.01*10^5;
for i=1:9;
p(i+1)=p(i)+100;
end
sd=(Ad*p)/(2*rho*g*Veo);
kdd=sd*(ad-r*keb);
kdp=sd*ap;
kpp=sd*o*(r*kcb+ap);
kpd=sd*o*ad;
B=[1 1 1 1 1 1 1 1 1 1];
C=2*(rw*ep+ed);
C(1:10)=C;
D=(1-kdd)+(rw^2+kpp)+4*rw*ep*ed;
E=2*ed*(rw^2+kpp)+rw*ep*(1-kdd);
F=(rw^2+kpp).*(1-kdd)+kpd.*kdp;
B=B';
C=C';
D=D';
E=E';
F=F';
w=[B C D E F];
[m,n] = size(w) ;
r = zeros(m,n-1) ;
for i = 1:m
r(i,:) = roots(w(i,:)) ;
end
r=real(r);
r=r(r>=0);
r=unique(r);
plot(sd,r);
hold on
end

댓글 수: 7

Ali
Ali 2020년 6월 10일
KSSV
KSSV 2020년 6월 10일
In the above code you have not defined many variables......so thats the code I have given....show us the complete code..so that we can help you.
Ali
Ali 2020년 6월 10일
I have define all variables but no plot show by matlab..
KSSV
KSSV 2020년 6월 10일
Unless you show whole code, we cannot help.
KSSV
KSSV 2020년 6월 10일
What is this line?
i = 0.75:0.30
Did I give in that way? Replace this with
i = 1:length(T) ;
Any ways your code will give errors. Your code is messy.
Ali
Ali 2020년 6월 10일
what should I do??
KSSV
KSSV 2020년 6월 10일
Think about the problem and logic.....why p is a vector in there?

이 질문은 마감되었습니다.

태그

질문:

Ali
2020년 6월 10일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by