Call function with other function

1 次查看(过去 30 天)
Skydriver
Skydriver 2019-9-5
评论: Rik 2019-9-5
I have function with the name file with the name SS14_EQS.m and I will call for computing using RunSS14_EQS.m.
But the comment : Function definitions in a script must appear at the end of the file.
Move all statements after the "SS14_EQS" function definition to before
the first local function definition.
Is there any one can help me?
Thanks
  1 个评论
Rik
Rik 2019-9-5
The function in RunSS14_EQS is not at the end of the script file. You can put functions in script files to have them available as local functions, but you can't put any code after the function/functions.
The function in RunSS14_EQS will likely not run, because the statements inside it are only valid if they are functions on your path, and setting them as variables is likely not allowed on your release. You are also not calling that local function.
The SS14_EQS function in its own file is also shadowed by the internal function, meaning it will not be called.
The clc,clear all,close seems unnecessary (and mlint is probably giving you a warning).
So the question is this: what are you trying to do? Have you already done a tutorial for how to use Matlab?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by