- Timestamp:
- 04/16/12 17:40:30 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp
r11936 r12011 222 222 } 223 223 /*}}}*/ 224 /*FUNCTION DoubleMatExternalResult::SetMatlabField{{{1*/225 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)226 void DoubleMatExternalResult::SetMatlabField(mxArray* dataref){227 228 mxArray* pfield=NULL;229 mxArray* pfield2=NULL;230 char* name=NULL;231 double* doublemat=NULL;232 233 /*Make a copy of the value, to be used by matlab: */234 doublemat=(double*)xmalloc(M*N*sizeof(double));235 memcpy(doublemat,values,M*N*sizeof(double));236 237 /*recover name: */238 this->GetResultName(&name);239 240 /*create matlab matrix: */241 pfield=mxCreateDoubleMatrix(0,0,mxREAL);242 mxSetM(pfield,N);243 mxSetN(pfield,M);244 mxSetPr(pfield,doublemat);245 246 /*transpose the matrix, from c to matlab format */247 mexCallMATLAB(1,&pfield2, 1, &pfield, "transpose");248 249 /*set tranpose matrix inside the dataref structure: */250 mxSetField( dataref, this->step-1, name,pfield2);251 mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));252 mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));253 254 }255 #endif256 /*}}}*/257 224 /*FUNCTION DoubleMatExternalResult::GetStep{{{1*/ 258 225 int DoubleMatExternalResult::GetStep(void){
Note:
See TracChangeset
for help on using the changeset viewer.