root/applications/bdmtoolbox/mex/class_defaults.cpp @ 795

Revision 790, 1.1 kB (checked in by smidl, 14 years ago)

add way of checking result of UI::build in matlab

Line 
1/*!
2\file
3\brief check how the structure is processed
4
5
6 */
7
8#include <stat/emix.h>
9#include <estim/particles.h>
10#include <estim/kalman.h>
11#include <mpdm/arx_agent.h>
12
13
14using namespace bdm;
15
16#ifdef MEX
17#include <mex/mex_parser.h>
18
19void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) {
20        // Check the number of inputs and output arguments
21        if ( n_input<1 ) mexErrMsgTxt ( "Usage:\n"
22                                                "instance=class_defaults(struct)\n"
23                                                "  struct              % configuration structure of a class\n"
24                                                "output:\n"
25                                                "  the same structure filled with the defaults.\n\n"
26                                                "This operation is usefull for obtaining info about a class construction" );
27
28        RV::clear_all();
29        //CONFIG
30        UImxArray Cfg(input[0]);
31        shared_ptr<root> r=UI::build<root>(Cfg);
32       
33        if ( n_output<1 ) mexErrMsgTxt ( "No output - nothing to do!" );
34        UImxArray Ret;
35        UI::save(r, Ret.getRoot());
36       
37        output[0] = Ret.create_mxArray();
38}
39#endif
Note: See TracBrowser for help on using the browser.