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.
0 个评论
回答(2 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Entering Commands 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!