The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: mex function for beginners
Replies: 13   Last Post: Aug 3, 2011 12:52 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Rune Allnor

Posts: 4,455
Registered: 12/7/04
Re: mex function for beginners
Posted: Sep 1, 2007 2:36 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 1 Sep, 08:26, "basudha pradhan" <>
> I just started learning writing mex function. In C function
> bitplan(), it take integer array as an input and it convert
> each element of array from decimal to 8 bit binary. then
> MSB of every element is taken and written to a file, after
> that next significant bit of every element is taken and
> written to a file. In this way integer array is separated
> into bit plane.
> I have tested the C function it works properly.

How did you test it?

> But mex
> function that i wrote doesn't give the correct output.

That's a clue for where to look for an error, right?

> However it compiles with no error.

C is a beast; you have to master it. It gives you
exactly what you ask for, it is your job to ask
for what you want...

> /* Get the data. */
> pr = (int *)mxGetPr(prhs[0]);

Could you explain this line for me?


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.