Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an established way to use configuration files for a deployed MATLAB application?

I am working with a MATLAB project, and would like to be able to configure variables and paths without re-creating the executable (currently done by using MATLAB's built-in deploytool). I realize I can create a simple text file, listing key=value pairs, and read that in during run-time. There doesn't seem to be any built-in support in MATLAB for creating configuration files that follow a standard format.

Are there any standard existing ways to use configuration files for MATLAB-generated executables?

like image 214
joanna Avatar asked Nov 05 '22 06:11

joanna


1 Answers

1) Add your resource to the package in DeployTool in the shared resources part
2) Read by using:

fullfile(ctfroot(),'config.txt');

Edit : That is suitable if your configuration is "private", that is the user should not edit it. In this case it is deployed together with your program as a resource. If you want a "public" config for the users, I know of no better way than to do what you offered.

like image 55
Andrey Rubshtein Avatar answered Nov 09 '22 11:11

Andrey Rubshtein