How to execute saved function file
1 回表示 (過去 30 日間)
古いコメントを表示
Hayatullahi Adeyemo
2017 年 11 月 20 日
コメント済み: Hayatullahi Adeyemo
2017 年 11 月 20 日
I read a function file and save it in a cell array. I modified the content of the cell array that contains each line of the function. I then saved it in another function file. Can I immediately execute the newly saved [function] file given some input values. I tried it and intend to save the output of the function in a matrix, it seems like I get same result always (which is wrong) based on the content of the matrix after executing a loop. Please advise me on what to do to have normal and accurate result on executing the immediately written function file.
0 件のコメント
採用された回答
Walter Roberson
2017 年 11 月 20 日
After you save a function to a .m file, you should "clear" the function name to remove any cached code of the function.
その他の回答 (1 件)
ES
2017 年 11 月 20 日
Do you save it in a different file name (and function name)?
If NO, then its highly likely that your old file gets executed (especially if its higher on the path or in the current directory).
参考
カテゴリ
Help Center および File 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!