Easy to edit configuration file for matlab function

As in the ini file, I basically want to have an easy-to-edit configuration file that can be used to read and distribute information in matlab objects. I know that people recommend xml, but the format is not easy for the user to edit. Can anyone else have a way?

+6
source share
2 answers

I always use YAML files for configuration files with MATLAB applications. I found them easy to read and editable, manageable versions and very easy to use.

They have an advantage (over the MATLAB script), also widely read by other languages ​​(Perl, Python, Ruby, Java, etc.) if the configuration files should also be used by other parts of the wider application.

There is a YAML file reader for MATLAB (a wrapper around Apache's free Java SnakeYaml library), which is publicly available. I also wrote my own, with which I would be happy to share (it is based on the package I am associated with, with slightly less functionality, but a little easier to understand code and a bit more reliable).

+4
source

Why not use ini files - for simple editing and reading, they cannot be beaten? They have difficulty problems, but as long as you are aware of this.

file sharing is your friend: http://www.mathworks.com/matlabcentral/fileexchange/24992-ini-config

You can also use Java property files. (I could not find anything in the file exchange. You will need to write the interface yourself.)

+2
source

Source: https://habr.com/ru/post/915335/


All Articles