#include <base/user_info.h>
#include <itpp/itmex.h>
#include <mex/mex_parser.h>

using namespace bdm;

void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) {
	if ( n_input>0 ) {
		string filename = mxArray2string ( input[0] );
		try {
			if ( n_output>0 )
			{
				UIFile C ( filename.c_str() );
				output[0] = UImxArray::create_mxArray( C );
			}
		} catch ( SettingException xcptn ) {
			cout<<"Error in:" + string ( xcptn.getPath() ) <<endl;
		} catch ( exception e ) {
			cout <<"Error: " << e.what() <<endl;
		}
	}
}
