Changeset 395 for applications/bdmtoolbox
- Timestamp:
- 06/22/09 13:17:49 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/bdmtoolbox/mex/merger_mx.cpp
r393 r395 83 83 Merger->set_sources(Sources,true); // takes care of deletion of sources 84 84 Merger->merge(); 85 85 86 mxArray* tmp ; 86 87 // Save results 87 88 if (n_output>0){ 88 mxArray*tmp = mxCreateStructMatrix(1,1,0,NULL);89 tmp = mxCreateStructMatrix(1,1,0,NULL); 89 90 //support 90 91 Array<vec> &samples=Merger->_Smp()._samples(); … … 100 101 vec2mxArray(w,fldw); 101 102 mxReplaceFieldNM(tmp, "weights", fldw); 102 103 104 // sources 105 char srcstr[20]; 106 for (int i=0;i<Sources.length();i++){ 107 sprintf(srcstr,"source%d",i+1); 108 vec sll=exp(Sources(i)->evallogcond_m(Merger->_Smp()._samples(),vec(0))); 109 110 mxArray* fldw=mxCreateDoubleMatrix(1, sll.length(), mxREAL); 111 vec2mxArray(sll/sum(sll),fldw); 112 mxReplaceFieldNM(tmp, srcstr, fldw); 113 } 114 103 115 output[0] = tmp; 104 116 }