Save vector to m-file
조회 수: 11 (최근 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!