How to use XSteam m-file with Simulink?

8 ビュー (過去 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 :(

Community Treasure Hunt

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

Start Hunting!

Translated by