How can I input "function Txy (Z1,Z2,P)" properly?

1 次查看(过去 30 天)
How can I input "function Txy (Z1,Z2,P)" properly?
How can I input "function Txy (Z1,Z2,P)" properly? It says that the error is: Error: Function definition not supported in this context. Create functions in code file.

回答(2 个)

Walter Roberson
Walter Roberson 2020-4-3
You have to store the code in a file named Txy.m

Geoff Hayes
Geoff Hayes 2020-4-3
Kalynn - it sounds like you are calling the function from the command line like
>> function Txy (Z1,Z2,P)
The function keyword is used only to declare a function in the Txy.m file. To call this function at the command line, or from a script, or from another function, then you just call it using the function name (in this case Txy) and ensure that you are passing in appropriately defined values for each of the three inputs. For example, I might call this function (at the command line) like
>> Txy(1, 2, 3)
I have no idea what the true input values should be and so am just using 1, 2, 3 as an example.

类别

Help CenterFile Exchange 中查找有关 Entering Commands 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by