필터 지우기
필터 지우기

How to use XSteam m-file with Simulink?

조회 수: 7 (최근 30일)
Tarek Sobh
Tarek Sobh 2014년 2월 23일
답변: Carminatti 2019년 6월 19일
Hello everyone, I'm trying to use XSteam m-file with Simulink. The code that I'm using inside the MATLAB Function block goes as follows:
function h10 = fcn(t10)
%#codegen
coder.extrinsic('XSteam');
h10 = coder.nullcopy(zeros(size(t10)));
h10=XSteam('hV_T',t10);
With this, I'm not getting the output 'h10' and I'm getting the following error:
Making simulation target "SSubstitution_sfun", ...
/bin/bash: /Applications/MATLAB: No such file or directory
I'm getting my answer with simply writing the following in MATLAB's Command Window:
XSteam('hV_T',4.5)
ans =
2.5092e+03
as t10=4.5 and h10=2.5092e+03. Would really appreciate your help guys. Thanks

답변 (2개)

Carminatti
Carminatti 2019년 6월 19일
Hello There,
I am sorry to answer this question only five years after you posted, but here is how to use the XSteam library within Simulink:
You will have to use the level2 S-Function block.
within that block, on the Outputs section you can use the XSteam, or any other (I believe) matlab function.
Using the level2 S-function looks complicated but following this youtube video might help a lot:
In my case I was able to use the XSteam function within another code inside Simulink.

Tarek Sobh
Tarek Sobh 2014년 2월 28일
I'm still stuck here :(

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by