Converting a Python Code to run on MATLAB

Hi,
I have a particular block of code which I want to format so that I can run it on MATLAB. Could you please help me out with getting this converted?
import os, numpy as np
from ctREFPROP.ctREFPROP import REFPROPFunctionLibrary
def NBP():
RP = REFPROPFunctionLibrary(os.environ['RPPREFIX'])
print(RP.RPVersion())
RP.SETPATHdll(os.environ['RPPREFIX'])
r = RP.SETUPdll(1,"PROPANE.FLD","HMX.BNC","DEF")
assert(r.ierr == 0)
print(RP.PQFLSHdll(101.325, 0, [1.0], 0))
if __name__=='__main__':
# Print the version of REFPROP in use and the NBP
NBP()

댓글 수: 3

Sindar
Sindar 2020년 10월 19일
When asking conversion questions, the algorithm is more important than the code. What does this code do?
The code is actually a function that is created on Python which can be called by NBP() to produce thermodynamic table values for the specified conditions as can be seen in the RP.PQFLHdll line. The function retrives data from a software named REFPROP to generate the values.
Walter Roberson
Walter Roberson 2020년 10월 19일
There are matlab interfaces to refprop

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기

질문:

2020년 10월 19일

댓글:

2020년 10월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by