91 | | <a name="l00029"></a>00029 <span class="comment">//copy vectors to mxStruct</span> |
92 | | <a name="l00030"></a>00030 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i=0; i<names.length();i++){ |
93 | | <a name="l00031"></a>00031 mat& M=vectors(i); |
94 | | <a name="l00032"></a>00032 mxArray* fld=mxCreateDoubleMatrix(M.rows(), M.cols(), mxREAL); |
95 | | <a name="l00033"></a>00033 mat2mxArray(M,fld); |
96 | | <a name="l00034"></a>00034 mxReplaceFieldNM(tmp, names(i).c_str(), fld); |
97 | | <a name="l00035"></a>00035 } |
98 | | <a name="l00036"></a>00036 <span class="keywordflow">return</span> tmp; |
99 | | <a name="l00037"></a>00037 } |
100 | | <a name="l00038"></a>00038 }; |
101 | | <a name="l00039"></a>00039 |
102 | | <a name="l00040"></a>00040 <span class="keyword">class </span>UImexlog: <span class="keyword">public</span> UIbuilder{ |
103 | | <a name="l00041"></a>00041 <span class="keyword">public</span>: |
104 | | <a name="l00042"></a>00042 UImexlog():UIbuilder(<span class="stringliteral">"mexlog"</span>){}; |
105 | | <a name="l00043"></a>00043 bdmroot* build(Setting &S)<span class="keyword"> const</span>{ |
106 | | <a name="l00044"></a>00044 <span class="keywordflow">return</span> <span class="keyword">new</span> mexlog(S[<span class="stringliteral">"maxlen"</span>]); |
107 | | <a name="l00045"></a>00045 }; |
108 | | <a name="l00046"></a>00046 }; |
109 | | <a name="l00047"></a>00047 UIREGISTER(UImexlog); |
| 91 | <a name="l00029"></a>00029 <span class="comment">//copied from itsave</span> |
| 92 | <a name="l00030"></a>00030 <span class="keywordtype">int</span> i; |
| 93 | <a name="l00031"></a>00031 <span class="keywordtype">string</span> vec_name=<span class="stringliteral">""</span>; |
| 94 | <a name="l00032"></a>00032 <span class="keywordtype">int</span> istart, iend; |
| 95 | <a name="l00033"></a>00033 |
| 96 | <a name="l00034"></a>00034 mat M; <span class="comment">//temporary matrix</span> |
| 97 | <a name="l00035"></a>00035 <span class="keywordflow">for</span> ( i=0; i<entries.length();i++ ) { |
| 98 | <a name="l00036"></a>00036 istart=0; |
| 99 | <a name="l00037"></a>00037 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j=0; j<entries(i).length(); j++){ <span class="comment">// same for as in add!!!</span> |
| 100 | <a name="l00038"></a>00038 vec_name = names(i) + entries(i).name(j); |
| 101 | <a name="l00039"></a>00039 iend=istart+entries(i).size(j)-1; |
| 102 | <a name="l00040"></a>00040 M=vectors(i).get_cols(istart,iend); |
| 103 | <a name="l00041"></a>00041 istart=iend+1; |
| 104 | <a name="l00042"></a>00042 <span class="comment">// copy the selection to mx</span> |
| 105 | <a name="l00043"></a>00043 mxArray* fld=mxCreateDoubleMatrix(M.rows(), M.cols(), mxREAL); |
| 106 | <a name="l00044"></a>00044 <a class="code" href="group__mexfiles.html#g662aa389e9c98b92a4880e2ab1241779" title="Convert mat to the matlab-format mxArray.">mat2mxArray</a>(M,fld); |
| 107 | <a name="l00045"></a>00045 mxReplaceFieldNM(tmp, vec_name.c_str(), fld); |
| 108 | <a name="l00046"></a>00046 } |
| 109 | <a name="l00047"></a>00047 } |
| 110 | <a name="l00048"></a>00048 <span class="keywordflow">return</span> tmp; |
| 111 | <a name="l00049"></a>00049 } |
| 112 | <a name="l00050"></a>00050 }; |
| 113 | <a name="l00051"></a>00051 |
| 114 | <a name="l00052"></a>00052 <span class="keyword">class </span>UImexlog: <span class="keyword">public</span> UIbuilder{ |
| 115 | <a name="l00053"></a>00053 <span class="keyword">public</span>: |
| 116 | <a name="l00054"></a>00054 UImexlog():UIbuilder(<span class="stringliteral">"mexlog"</span>){}; |
| 117 | <a name="l00055"></a>00055 bdmroot* build(Setting &S)<span class="keyword"> const</span>{ |
| 118 | <a name="l00056"></a>00056 <span class="keywordflow">return</span> <span class="keyword">new</span> mexlog(S[<span class="stringliteral">"maxlen"</span>]); |
| 119 | <a name="l00057"></a>00057 }; |
| 120 | <a name="l00058"></a>00058 }; |
| 121 | <a name="l00059"></a>00059 UIREGISTER(UImexlog); |