MATLAB File Help: cv.FileStorage Index
cv.FileStorage

Reading from or writing to a XML/YAML file storage

S = cv.FileStorage(fileName)
cv.FileStorage(fileName, S)
cv.FileStorage(fileName, X1, X2, ...)

Input

Output

The function reads or writes a Matlab object from/to a XML/YAML file. The file is compatible to OpenCV formats. When input argument is not a scalar struct, the function creates a scalar struct with default field name and stores the objects in that struct.

A quick usage example is shown below:

Writing to a file

S = struct('field1', randn(2,3), 'field2', 'this is the second field');
cv.FileStorage('my.yml',S);

Reading from a file

S = cv.FileStorage('my.yml');

Replace '.yml' to '.xml' to use XML format.

See also