Save vector to m-file
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
dpb
am 2 Okt. 2014
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?
Antworten (1)
Oleg Komarov
am 2 Okt. 2014
Bearbeitet: Oleg Komarov
am 2 Okt. 2014
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 Kommentare
Siehe auch
Kategorien
Mehr zu Testing Frameworks finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!