Plotting Issue with code

조회 수: 1 (최근 30일)
Giuseppe Rossi
Giuseppe Rossi 2019년 12월 31일
댓글: Rena Berman 2020년 1월 16일
Having problems with the plot of Temp vs XE,
X vs Temp
Temp vs Kc
X vs Kc
all produce plots which are expected but when XE is involved there isn't a plot produced..
Any advice?Code:
function
%Given Data
To=325;
dH=-20000;
Cpa=20;
Cpb=20;
Kc1=1000;
R=0.001987;
dH1=-20; % dH x 10^-3
X=0:0.01:1.0;
plot(Temp,XE);
  댓글 수: 1
Rena Berman
Rena Berman 2020년 1월 16일
(Answers Dev) Restored edit

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

답변 (1개)

Bhaskar R
Bhaskar R 2019년 12월 31일
MATLAB operator "/" does Solve systems of linear equations, use "./" operator instead for element wise division operation
function Plot5
%Given Data
To=325;
dH=-20000;
Cpa=20;
Cpb=20;
Kc1=1000;
R=0.001987;
dH1=-20; % dH x 10^-3
X=0:0.01:1.0;
%Derived Equations
Temp=325+((X*20000)/(40));
Kc=1000*(exp((-20/0.001987)*((1/305)-((1./Temp)))));
XE=((4.*Kc)-sqrt(((16*(Kc.^2))-(12*(Kc-4).*Kc))))./(2.*(Kc-4)); % changed / to ./
plot(Temp,XE);

카테고리

Help CenterFile Exchange에서 Labels and Styling에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by