I downloaded IAPWS_IF97.m file. I try to use any of the noted functions but Matlab just states:
"??? Undefined function or variable 'v_pT'."
I can write other functions and they work. I guess it is something in the .m file.
Any help is greatly appreciated.

3 件のコメント

Stephen23
Stephen23 2016 年 5 月 12 日
編集済み: Stephen23 2016 年 5 月 12 日
So you downloaded an Mfile (but you are not going to show us where from), and when you try to use the Mfile (and you don't show us how you try to use it) the Mfile gives an error (which you showed only one line of) and you suspect that "it is something in the .m file" (but of course you did not show us the Mfile either).
Now let me read my crystal ball and check my tarot cards to find out what the problem is...
Or would you prefer to actually give us some real information to help us diagnose the problem?
Taylor
Taylor 2016 年 5 月 12 日
So nice..
I put the IAPWS_IF97.m file in my file path. Matlab acknowledges the functions in the bottom left screen.
I try typing in IAPWS_IF97(v_pT, 50, 290) but it provides me error in my question.
Stephen23
Stephen23 2016 年 5 月 13 日
編集済み: Stephen23 2016 年 5 月 13 日
You forgot to make the first argument a string:
IAPWS_IF97('v_pT', 50, 290)
This is shown quite clearly in the documentation given at the link you gave.

サインインしてコメントする。

回答 (2 件)

Walter Roberson
Walter Roberson 2016 年 5 月 12 日

0 投票

3 件のコメント

Taylor
Taylor 2016 年 5 月 12 日
So I place the IAPWS_IF97 file in the path. Matlab shows the functions in the bottom left screen. It is just when I try to use the function in the workspace like so:
IAPWS_IF97(v_pT, 50, 290)
It give me the error I provided above.
Can you try typing that function in above and see if it works for you?
John D'Errico
John D'Errico 2016 年 5 月 12 日
Have you actually defined the variable v_pT in the current workspace, so that it can be passed into this function?
Walter Roberson
Walter Roberson 2016 年 5 月 12 日
IAPWS_IF97('v_pT', 50, 290)

サインインしてコメントする。

John D'Errico
John D'Errico 2016 年 5 月 12 日

0 投票

I'll guess your problem is for some reason, you have not bothered to define the variable v_pT that you are then passing into the function.
MATLAB is telling you that you have not done so. It would give anyone exactly the same error, IF they had no variable with that name in their workspace, but then tried to call the function as
IAPWS_IF97(v_pT, 50, 290)
You have not provided enough information to know this is the answer. But your apparent lack of understanding of MATLAB in general seems to suggest this as the case.

2 件のコメント

Taylor
Taylor 2016 年 5 月 12 日
編集済み: Taylor 2016 年 5 月 12 日
Okay, I got it. I'm suppose to use 'v_pT'... That is the function I am trying to find per the instructions. So it isn't suppose to be an input variable.
I will try when I get home.
John D'Errico
John D'Errico 2016 年 5 月 12 日
I don't know if this is intended to be a function, as part of what you downloaded, or if it is a variable. But MATLAB cannot find something with that name in your workspace, or in your directories.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File Exchange で Downloads についてさらに検索

質問済み:

2016 年 5 月 12 日

編集済み:

2016 年 5 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by