indices on the right incompatible

1 view (last 30 days)
Chinaemerem Valentine Nwobi
Edited: madhan ravi on 17 May 2019
% am trying to run this my program with the function script and the input
% data given below. please have a look to know what am doing wrong
%%
function[PB,Ybub]=PB_VLE_NRTL(x,C,T,BIP)
% this is a function that calculates the bubble point using the wilson
% activity coeefficient model.
c=length(x);
for i=1:c
Psi=exp((C(i,1))+(C(i,2)/T)+(C(i,3)*log(T))+(C(i,4)*T^C(i,5)));
[gamma,~]=ACTIVITY_NRTL(BIP,alpha,T,x);
PB=sum(Psi.*x*gamma);
Ybub=Psi.*gamma/PB;
end
%% problem 2
% in order to determine the state of aggregation of the system
T=353.15;
P=101325;
i=1:2;
x=[0.5 0.5];
BIP=[196.250 386.133];
C(i)=[88.134 -8498.6 -9.0766 8.330e18 6];
C(i)=[153.23 -10055 -19.488 1.6426e5 2];
  3 Comments
madhan ravi
madhan ravi on 17 May 2019
Probably you’re not aware of how to call a function.
Google : How to a call a function? MATLAB

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!