다른 버전에서 코딩파일이 실행되는데 제 버전에선 코딩이 실행 되지 않습니다.

3 views (last 30 days)
윤학 최 on 17 May 2021
alpha=2.45; q=0.80; zf=0.5; xd=0.9; xb=0.1; R=1.5;
[feedn, totaln]=bindistMT(alpha,q,zf,xd,xb,R);
function [feedn, totaln] = bindistMT(alpha,q,zf,xd,xb,R)
% bindistMT.m: McCabe/Thiele 이성분계 증류
% input
% alpha: 상대휘발도
% q: 원료조건
% zf,xd,xb: 원료, 탑상제품, 탑저제품 조성(물분율)
% R: 환류비
% output
% feedn: 원료단
% totaln: 총 단수
% 초기화 및 평형곡선 계산
y = 0:0.1:1; ye = y; xe = ye./(alpha + (1-alpha)*ye);
xq = ((R+1)*zf + (q-1)*xd)/(R + q); yq = (R*zf + q*xd)/(R + q);
figure(1)
plot(xe,ye,'r'); hold on, axis([0 1 0 1]);
set(line([0 1],[0 1]),'Color',[0 0 0]);
set(line([xd xq],[xd yq]),'Color',[1 0 1]);
set(line([zf xq],[zf yq]),'Color',[1 0 1]);
set(line([xb xq],[xb yq]),'Color',[1 0 1]);
% 정류부분(Rectifying section)
i = 1; xop(1) = xd; yop(1) = xd; y = xd;
while (xop(i) > xq)
xop(i+1) = y./(alpha + (1-alpha)*y);
yop(i+1)=R*xop(i+1)/(R+1) + xd/(R+1); % 정류부분에서의 조업선
y = yop(i+1);
set(line([xop(i) xop(i+1)],[yop(i) yop(i)]),'Color',[0 0 1]);
if (xop(i+1) > xq)
set(line([xop(i+1) xop(i+1)],[yop(i) yop(i+1)]),'Color',[0 0 1]);
end
i = i+1;
end
feedn = i-1;
% 탈거부분(Stripping section)
c1 = (yq - xb)/(xq - xb); c2 = (yq - xq)/(xq - xb);
yop(i) = c1*xop(i) - c2*xb; y = yop(i);
set(line([xop(i) xop(i)],[yop(i-1) yop(i)]),'Color',[0 0 1]);
while (xop(i)>xb)
xop(i+1) = y/(alpha + (1-alpha)*y);
yop(i+1) = c1*xop(i+1) - c2*xb; y = yop(i+1);
set(line([xop(i) xop(i+1)],[yop(i) yop(i)]),'Color',[0 0 1]);
if (xop(i+1) > xb)
set(line([xop(i+1) xop(i+1)],[yop(i) yop(i+1)]),'Color',[0 0 1]);
end
i=i+1;
end
set(line([xop(i) xop(i)],[yop(i-1) yop(i)]),'Color',[0 0 1]);
hold off, xlabel('x'), ylabel('y'), totaln = i-1;
fprintf('Feed stage = %g\n', feedn);
fprintf('총 단수 = %g\n', totaln);
end
'bindistMT'은(는) 인식할 수 없는 함수 또는 변수입니다.
Caught "std::exception" Exception message is:
Invalid character code sequence detected.
>>

Shiva Kalyan Diwakaruni on 26 May 2021
Hi,
I see that you are trying to call and run bindistMT function from command window which is leading to error "'bindistMT'은(는) 인식할 수 없는 함수 또는 변수입니다" because You are trying to call the function which is not defined yet and however Function definition are not supported in command window.Hence we suggest you to save the above code by creating a new script .
And regarding the "Invalid character code sequence detected."
"Invalid character code sequence detected." usually means non-English characters in path or file name. Some potential path:
>> tempdir
>> prefdir
>> matlabroot
>> !hostname
In this case, !hostname contains non english characters. Change it to pure English and it will work
Hope it helps.