Save vector to m-file
10 ビュー (過去 30 日間)
古いコメントを表示
Hi. I have a task where I am to create a file called bestPath.m which in turn should include a vector called bestPath. I have searched the net, but no luck. Thanks in advance.
2 件のコメント
dpb
2014 年 10 月 2 日
Not a good idea...the resulting variable will alias the function name--altho I suppose that could be the intent??
As for the mechanics of doing so, what's the specific problem?
回答 (1 件)
Oleg Komarov
2014 年 10 月 2 日
編集済み: Oleg Komarov
2014 年 10 月 2 日
a = rand(10);
matlab.io.saveVariablesToScript('test.m','a')
Check the content of the .m file with
edit test
Calling test from the command line will evaluate a into the workspace.
2 件のコメント
参考
カテゴリ
Help Center および File Exchange で Testing Frameworks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!