Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wrong result of assignment

Status
Not open for further replies.

adobhal

Electrical
Joined
Jul 13, 2005
Messages
1
Location
US
Following lines of code is not giving me desired result, I want to have the value of plhs[5] in a double variable.

...

plhs[5]= mxCreateDoubleMatrix(1,1,mxREAL);

/*At this place I have some mexCallFunctions to assign plhs[5] some values*/

mexCallMATLAB(0,NULL,1,&plhs[5],"disp");
/* The above call gives me 1/3, which is correct*/

double *lr;

lr =mxGetPr(plhs[5]);

mexPrintf("\nvalue of lr:%e",lr[0]);
/* The above lines gives me 3.133877e-306, don't know why??*/


Please help me.
 
Does
lr = mxGetPr( & plhs[ 5 ] );
give you the correct result?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top