How do I find the name of the currently-running Matlab LiveScript?
I have a Matlab LiveScript case study which calls many .m functions. At the bottom of the LiveScript, I need to save the results of my case study to a .mat file, and I want the name of the .mat file to be the same as my case study file. For example, if my case study file is named
Case_Something.mlx, then I want the associated results file to be named
Case_Something.mat
I have been relying on the users to change the name of the .mat file for each case they create, but if they forget, they overwrite someone else’s .mat file. If I can recover the name "Case_Something" from the .mlx filename runnning, I can make this automatic. All descriptions of how to do this are examples for .m files, not LiveScripts, and the solutions don’t work.
Is there a way to do this with LiveScripts?
Thanks for any help.I have a Matlab LiveScript case study which calls many .m functions. At the bottom of the LiveScript, I need to save the results of my case study to a .mat file, and I want the name of the .mat file to be the same as my case study file. For example, if my case study file is named
Case_Something.mlx, then I want the associated results file to be named
Case_Something.mat
I have been relying on the users to change the name of the .mat file for each case they create, but if they forget, they overwrite someone else’s .mat file. If I can recover the name "Case_Something" from the .mlx filename runnning, I can make this automatic. All descriptions of how to do this are examples for .m files, not LiveScripts, and the solutions don’t work.
Is there a way to do this with LiveScripts?
Thanks for any help. I have a Matlab LiveScript case study which calls many .m functions. At the bottom of the LiveScript, I need to save the results of my case study to a .mat file, and I want the name of the .mat file to be the same as my case study file. For example, if my case study file is named
Case_Something.mlx, then I want the associated results file to be named
Case_Something.mat
I have been relying on the users to change the name of the .mat file for each case they create, but if they forget, they overwrite someone else’s .mat file. If I can recover the name "Case_Something" from the .mlx filename runnning, I can make this automatic. All descriptions of how to do this are examples for .m files, not LiveScripts, and the solutions don’t work.
Is there a way to do this with LiveScripts?
Thanks for any help. live script, filename, running, save, with same name as MATLAB Answers — New Questions