Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F122527974
plinproj.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jul 18, 08:02
Size
1 KB
Mime Type
text/x-c
Expires
Sun, Jul 20, 08:02 (2 d)
Engine
blob
Format
Raw Data
Handle
27470839
Attached To
R5163 Slepians
plinproj.c
View Options
#include <math.h>
#include "mex.h"
#include "matrix.h"
#include "geometry.h"
void
mexFunction
(
int
nlhs
,
mxArray
*
plhs
[],
int
nrhs
,
const
mxArray
*
prhs
[])
{
char
str
[
256
];
mxArray
*
proj
,
*
dist
;
double
*
l1
,
*
l2
,
*
r
,
*
proj_p
,
*
dist_p
;
int
flag
;
if
(
nrhs
<
3
||
nrhs
>
4
)
mexErrMsgTxt
(
"Invalid number of input arguments"
);
if
(
mxGetM
(
prhs
[
0
])
!=
1
||
mxGetN
(
prhs
[
0
])
!=
3
)
mexErrMsgTxt
(
"Invalid dimension for input argument 1"
);
if
(
mxGetM
(
prhs
[
1
])
!=
1
||
mxGetN
(
prhs
[
1
])
!=
3
)
mexErrMsgTxt
(
"Invalid dimension for input argument 2"
);
if
(
mxGetM
(
prhs
[
2
])
!=
1
||
mxGetN
(
prhs
[
2
])
!=
3
)
mexErrMsgTxt
(
"Invalid dimension for input argument 3"
);
l1
=
mxGetData
(
prhs
[
0
]);
l2
=
mxGetData
(
prhs
[
1
]);
r
=
mxGetData
(
prhs
[
2
]);
if
(
nrhs
==
4
)
flag
=
(
int
)
mxGetScalar
(
prhs
[
3
]);
else
flag
=
0
;
proj
=
mxCreateDoubleMatrix
(
1
,
3
,
mxREAL
);
dist
=
mxCreateDoubleMatrix
(
1
,
1
,
mxREAL
);
proj_p
=
mxGetData
(
proj
);
dist_p
=
mxGetData
(
dist
);
(
*
dist_p
)
=
plinproj
(
l1
,
l2
,
r
,
proj_p
,
flag
);
/* assign the output parameters */
plhs
[
0
]
=
proj
;
if
(
nlhs
>
1
)
plhs
[
1
]
=
dist
;
return
;
}
Event Timeline
Log In to Comment