Import data tool names does not name table according to filename when generating code as function
12 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2016 年 12 月 15 日
回答済み: MathWorks Support Team
2016 年 12 月 15 日
I have a file "temp.xlsx" that I am trying to import into MATLAB and save as a table. When I use the "Import Data" tool, I notice that the table is named according to the file name as "temp".
However, I want to automate this process, so I am generating the function code form the import data tool. when I call this function from the command line, the table is named as "ans" and not according to the file name as "temp" the way it was before.
Why is this? How can I automate this process and still get my variable to be named according to the file name?
採用された回答
MathWorks Support Team
2016 年 12 月 15 日
When generating the code as a function, the function code that is produced tries to make the process as generic as possible. This is why you have to reenter the file name when calling the function.
In order to automate the exact process specific to that file, you can instead generate the code as a script. Now, when you run the script, the variable is stored according to the filename that is present.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で MATLAB Code Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!