From: Junglen Tobias on 6 Aug 2010 09:13 Hi everybody, I have a problem using mexCallMATLAB in an mexFunction. If I pass the mexFunction arguments directly into the mexCallMatlab, like mexCallMATLAB(nlhs,plhs,nrhs,prhs, "det"); everything works fine. When I need more input arguments in the outer mexFunction (say two matrices) and if I want to calculate the Determinant of the second Matrix in the prhs- pointer array, my mexCallMATLAB command looks like: mexCallMATLAB(nlhs,plhs,nrhs,prhs[1], "det"); As a result a segmentation error occurs. Any help is welcome! Best regards Tobias
From: Junglen Tobias on 6 Aug 2010 10:17 "Junglen Tobias" <t.junglen(a)trianel.com> wrote in message <i3h1p3$l1g$1(a)fred.mathworks.com>... > Hi everybody, > I have a problem using mexCallMATLAB in an mexFunction. If I pass the mexFunction arguments directly into the mexCallMatlab, like > mexCallMATLAB(nlhs,plhs,nrhs,prhs, "det"); > everything works fine. > When I need more input arguments in the outer mexFunction (say two matrices) and if I want to calculate the Determinant of the second Matrix in the prhs- pointer array, my mexCallMATLAB command looks like: > mexCallMATLAB(nlhs,plhs,nrhs,prhs[1], "det"); > As a result a segmentation error occurs. > > Any help is welcome! > Best regards > Tobias Dear all, I have found the mistake, the right way to do it is mexCallMATLAB(nlhs,plhs,nrhs,&prhs[1], "det"); because the adress of the mxArray should be the input. Perhaps this could be helpful to anyone. Bye, Tobias
From: Jim Rockford on 6 Aug 2010 11:25 On Aug 6, 10:17 am, "Junglen Tobias" <t.jung...(a)trianel.com> wrote: > Dear all, > I have found the mistake, the right way to do it is > mexCallMATLAB(nlhs,plhs,nrhs,&prhs[1], "det"); > because the adress of the mxArray should be the input. > Perhaps this could be helpful to anyone. > Bye, Tobias That is useful Tobias, thanks. It's always helpful when people post the solutions to problems they have posted. Jim
From: James Tursa on 6 Aug 2010 12:48 "Junglen Tobias" <t.junglen(a)trianel.com> wrote in message <i3h5h0$ofv$1(a)fred.mathworks.com>... > > ... the right way to do it is > mexCallMATLAB(nlhs,plhs,nrhs,&prhs[1], "det"); or mexCallMATLAB(1, plhs, 1, prhs+1, "det"); James Tursa
|
Pages: 1 Prev: simulate time series data Next: Problem using Kalman Filter estimation |