Does make it faster in calculation if i write the variables as letter rather than words ?

1 回表示 (過去 30 日間)
I have a code which takes so long processing, in this code the variables are written as words rather than letters, would it make work more efficiently if replace all words with letters ?
  2 件のコメント
madhan ravi
madhan ravi 2019 年 1 月 6 日
編集済み: madhan ravi 2019 年 1 月 6 日
Well , upload your code
Rik
Rik 2019 年 1 月 6 日
As far as my understanding of the internals of Matlab goes, it doesn't matter what your variable names are, and even if it would, the difference would be absolutely tiny.
A better bet is to use the profiler to identify what parts of your code are taking a long time, and use that to optimize your algorithm, instead of the code itself. If you are stuck with optimizing some part, you can post the code here (try to make a MWE so we can run your code without any other dependencies and can reproduce it).

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

採用された回答

Stephen23
Stephen23 2019 年 1 月 6 日
編集済み: Stephen23 2019 年 1 月 6 日
The variable name legnth is unlikely to make any noticeable difference to code execution speed, but the only way to be sure is to test it:
I would guess that any tiny difference that the variable name length might make would be swamped by random other tasks that your OS, MATLAB, and other applications demand from your processors, to the point that it is statistically insignificant.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by