From: Burhan Syla on
Hi,

I have a vector of uint8, going into an embedded function

The vector looks like that and his size may change

10
15
79
189
77
66
32
0

What i want is 1015791897766320 in double.

Is there a way to do that.??

Thank you
From: Burhan Syla on
I found a way to do that in my work space:

>> u = [1 2 5 7 8 9]

u =

1 2 5 7 8 9

>> sprintf('%g',u)

ans =

125789

But now, when i try to put that in an embedded function, I get this error :

Function 'sprintf' implicitly resolved in the MATLAB workspace. Implicit evaluation in MATLAB is not supported. Please declare this function extrinsic using eml.extrinsic('sprintf'), or call it using feval.

Function 'Embedded MATLAB Function' (#91.28.43), line 7, column 4:
"sprintf('%g',u)"
Launch diagnostic report.


How can I repair that? Do i have to call a specific library (like the math library in JAVA)??

Thx for your help
From: Steven Lord on

"Burhan Syla" <burhansyla(a)gmail.com> wrote in message
news:i1i52o$n9p$1(a)fred.mathworks.com...
> Hi,
>
> I have a vector of uint8, going into an embedded function
>
> The vector looks like that and his size may change
>
> 10
> 15
> 79
> 189
> 77
> 66
> 32
> 0
>
> What i want is 1015791897766320 in double.
>
> Is there a way to do that.??

There's no guarantee that the value you want to construct from the vector is
exactly representable in double precision, is there?

v = [uint8(1); zeros(200, 1, 'uint8')]

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com


From: us on
"Burhan Syla" <burhansyla(a)gmail.com> wrote in message <i1ic80$sn$1(a)fred.mathworks.com>...
> I found a way to do that in my work space:
>
> >> u = [1 2 5 7 8 9]
>
> u =
>
> 1 2 5 7 8 9
>
> >> sprintf('%g',u)
>
> ans =
>
> 125789
>
> But now, when i try to put that in an embedded function, I get this error :
>
> Function 'sprintf' implicitly resolved in the MATLAB workspace. Implicit evaluation in MATLAB is not supported. Please declare this function extrinsic using eml.extrinsic('sprintf'), or call it using feval.
>
> Function 'Embedded MATLAB Function' (#91.28.43), line 7, column 4:
> "sprintf('%g',u)"
> Launch diagnostic report.
>
>
> How can I repair that? Do i have to call a specific library (like the math library in JAVA)??
>
> Thx for your help

did you look at FEVAL(?)...

help feval;

us