How to use XSteam m-file with Simulink?
8 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
回答 (2 件)
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.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!