Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
create an executable

Subject: create an executable

From: Amish Rughoonundon

Date: 12 May, 2010 20:33:04

Message: 1 of 4

Hi I've tried to create an executable in vain.
1) Here is the code in the m file:
<CODE>
function fixedPointHexNumber = fixedPointHexNumber(number, hexDigits, fixedPointFractional)
if str2num(fixedPointFractional) >= str2num(hexDigits)*4
    fixedPointHexNumber = 'ERROR: Fractional part cannot be greater or equal (due to sign bit) to hexDigits*4';
else
    fiNumber = fi(str2double(number), true, str2num(hexDigits)*4, str2num(fixedPointFractional));
    intfiHexNumber = fiNumber.hex();
    fixedPointHexNumber = sprintf(intfiHexNumber);
end
</CODE>

I used the following to create the executable:
mcc -m -d ./matlab_compiled/ fixedPointHexNumber

When I tried to run the executable in a command prompt, I get the following:
??? Undefined function or method 'fi' for input arguments of type 'double'.
Error in ==> fixedPointHexNumber at 5
MATLAB:UndefinedFunction

I am a newb at matlab and completely lost.

Thanks for any help,
Amish

Subject: create an executable

From: ImageAnalyst

Date: 12 May, 2010 20:55:23

Message: 2 of 4

Take a look at this line in your code:

    fiNumber = fi(str2double(number), true, str2num(hexDigits)*4,
str2num(fixedPointFractional));

Can you tell me what fi() is? Is it a function, or a variable? Well
neither I, nor the executable seem to know.

Subject: create an executable

From: Walter Roberson

Date: 12 May, 2010 21:17:48

Message: 3 of 4

ImageAnalyst wrote:
> Take a look at this line in your code:
>
> fiNumber = fi(str2double(number), true, str2num(hexDigits)*4,
> str2num(fixedPointFractional));
>
> Can you tell me what fi() is? Is it a function, or a variable? Well
> neither I, nor the executable seem to know.

Sounds like something from the Fixed-Point Toolbox.

http://www.mathworks.com/products/ineligible_programs/

"ineligible for use on" the matlab compiler.

Subject: create an executable

From: Amish Rughoonundon

Date: 12 May, 2010 21:44:05

Message: 4 of 4

Walter Roberson <roberson@hushmail.com> wrote in message <0WEGn.1304$Ak3.1240@newsfe16.iad>...
> ImageAnalyst wrote:
> > Take a look at this line in your code:
> >
> > fiNumber = fi(str2double(number), true, str2num(hexDigits)*4,
> > str2num(fixedPointFractional));
> >
> > Can you tell me what fi() is? Is it a function, or a variable? Well
> > neither I, nor the executable seem to know.
>
> Sounds like something from the Fixed-Point Toolbox.
>
> http://www.mathworks.com/products/ineligible_programs/
>
> "ineligible for use on" the matlab compiler.

Thanks a lot,
 I didn't realize some toolboxes could not be used with the compiler.
Amish

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us