Effacer les filtres
Effacer les filtres

How to use XSteam m-file with Simulink?

7 vues (au cours des 30 derniers jours)
Tarek Sobh
Tarek Sobh le 23 Fév 2014
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

Réponses (2)

Carminatti
Carminatti le 19 Juin 2019
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 le 28 Fév 2014
I'm still stuck here :(

Catégories

En savoir plus sur Data Import and Analysis dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by