Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there already a YAML library/parser for MATLAB?

Tags:

yaml

matlab

I want to use YAML to communicate some data across multiple languages. (Think of it as "language-independent serialization".) One of these languages is MATLAB, but I can't seem to find a YAML library for that language. I've checked for "matlab yaml" and "matlab yaml parse" on Google and there don't seem to be any relevant results. A search of "yaml" on MATLAB Central also left me empty-handed.

Is there really no existing YAML library for MATLAB? I'm fine with writing one, but I would like to avoid duplicating work. (Perhaps something to share?)

like image 273
Benjamin Oakes Avatar asked Oct 28 '09 15:10

Benjamin Oakes


3 Answers

I extended Jan's code to support more data types as well as writing out of a matlab struct to yaml file. It is not just one m-file therefore I located the sources on http://code.google.com/p/yamlmatlab/ Jiri

like image 98
Jirka cigler Avatar answered Nov 15 '22 20:11

Jirka cigler


Call existing Java YAML import libraries from Matlab. This should be pretty strightforward. Java-Matlab interoperability is pretty good, see matlab help.

like image 22
Mikhail Poda Avatar answered Nov 15 '22 20:11

Mikhail Poda


There is now a matlab wrapper for snakeyaml:

http://code.google.com/p/yamlmatlab/

I've tried it out and it works pretty well on a simple yaml file. There are bugs if the yaml field names are not valid fieldnames and when strings are empty. I've suggested workarounds for both of these in the issues section on the google code site

like image 34
Marc Avatar answered Nov 15 '22 19:11

Marc