Export the MASCARET model or state in a file with the XML format
[error] = MASCARET_importXml(id,FileName,importModel)
(Output argument) Error code value : zero indicates that no errors occurred
MASCARET instance number returned by the function MASCARET_create
Name of the XML file containing the MASCARET model or state. The length of this string does not exceed 255 characters.
If true (value = 1), import a model. If not true (value = 0), import a state.
Export the MASCARET model or state in a file with the XML format
This function gives the possibility to import XML files containing a MASCARET model or state previously created by the function MASCARET_exportXml
Before using this function, it is necessary to create a MASCARET instance, with the help of the function MASCARET_create. If the state is imported, the model has to be initialized, with the help of one of the functions MASCARET_importModel or MASCARET_importXml with the last parameter equal to 1.
toolbox_dir=getenv("toolbox_dir"); c = filesep(); // creation of the MASCARET model [err, id] = MASCARET_create(); assert_checktrue(id>0); // import Model and State err = MASCARET_importXml(id,"file:"+toolbox_dir+c+"demos"+c+"Help"+c+"demo1"+c+"demo1_Model.xml",1); assert_checkequal(err,0); err = MASCARET_importXml(id,"file:"+toolbox_dir+c+"demos"+c+"Help"+c+"demo1"+c+"demo1_State.xml",0); assert_checkequal(err,0); // model deletion err = MASCARET_delete(id); assert_checkequal(err,0); | ![]() | ![]() |