"the scope of variable spans multiple functions matlab"

Can somebody tell me what is this message in "blue" variable "the scope of variable spans multiple functions matlab" ??
is it a nested function??
i have this code in attached image

1 件のコメント

Stephen23
Stephen23 2019 年 3 月 17 日
編集済み: Stephen23 2019 年 3 月 17 日
Those variables are used in nested functions. Nested functions are an intuitive and convenient way to simplify passing data between workspaces. Note that powutil4's alignment is misleading: the default MATLAB code alignment indents nested functions, which makes it clear which functions in a file are nested and which are local:

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

 採用された回答

Stephan
Stephan 2019 年 3 月 16 日

4 投票

Hi,
yes, it is due to the nested functions. It is one possible way to avoid global variables. There is nothing wrong with it. The documentation suggests this as a proper way instead of the usage of global variables. So no worry.
Best regards
Stephan

6 件のコメント

Panos Raptis
Panos Raptis 2019 年 3 月 16 日
Thanks a lot for quick answer
Ok these code its not mine and i want to adapt it on my data, these variables (blue) in pic which i attach it is returns from excel matrix....maybe you know how to span a variable with data from excel matrix?
Stephan
Stephan 2019 年 3 月 16 日
there a several ways. one idea could be xlsread or readtable.
Panos Raptis
Panos Raptis 2019 年 3 月 16 日
okay and how i will define nested and parent funtions?
Panos Raptis
Panos Raptis 2019 年 3 月 16 日
Thanks a lot
Stephan
Stephan 2019 年 3 月 16 日
Did you notice that you can accept and/or vote for useful answers? Feel free to do so on useful contributions.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

質問済み:

2019 年 3 月 16 日

編集済み:

2019 年 3 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by