Home > Archive > Matlab > February 2007 > Does matlab compiler support randn function?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Does matlab compiler support randn function?
|
|
| mailcwc@gmail.com 2007-02-28, 7:14 pm |
| I compiled the following code with VC6 in Windows XP sp2 successfully.
However, when I run test.exe, I got the following message. The test.m
file runs ok in the matlab. So it seems like matlab compiler does not
support randn.
I think randn is a very basic function which should definitely be
supported. Does any have similar experience? I uses mcc -m test.m to
build the exe file.
??? Error using ==> randn
Unknown command option.
Error in ==> test at 5
MATLAB:badopt
Compiler Name version: MSVC 6
============================ test.m ==============================
function y = test(N)
tic;
for i=1:10
for j=1:10
a=randn(N,N);
b=randn(N,N);
c=det(a);
d=fft(b);
e=a.*b;
end
end
toc
| |
| Tom Lane 2007-02-28, 7:14 pm |
| What input did you give to your test function? This can happen without the
compiler as well:
??? Error using ==> randn
Unknown command option.
-- Tom
<mailcwc@gmail.com> wrote in message
news:1172677310.754040.277350@k78g2000cwa.googlegroups.com...[color=darkred]
>I compiled the following code with VC6 in Windows XP sp2 successfully.
> However, when I run test.exe, I got the following message. The test.m
> file runs ok in the matlab. So it seems like matlab compiler does not
> support randn.
> I think randn is a very basic function which should definitely be
> supported. Does any have similar experience? I uses mcc -m test.m to
> build the exe file.
>
> ??? Error using ==> randn
> Unknown command option.
>
> Error in ==> test at 5
>
> MATLAB:badopt
>
> Compiler Name version: MSVC 6
> ============================ test.m ==============================
> function y = test(N)
> tic;
> for i=1:10
> for j=1:10
> a=randn(N,N);
> b=randn(N,N);
> c=det(a);
> d=fft(b);
> e=a.*b;
>
> end
> end
> toc
>
| |
|
| Hi,
keep in mind, that compiled applications always get their paremeter as
strings, so you need to do something like
if isdeployed
N = str2double(N);
end
Titus
<mailcwc@gmail.com> schrieb im Newsbeitrag
news:1172677310.754040.277350@k78g2000cwa.googlegroups.com...
>I compiled the following code with VC6 in Windows XP sp2 successfully.
> However, when I run test.exe, I got the following message. The test.m
> file runs ok in the matlab. So it seems like matlab compiler does not
> support randn.
> I think randn is a very basic function which should definitely be
> supported. Does any have similar experience? I uses mcc -m test.m to
> build the exe file.
>
> ??? Error using ==> randn
> Unknown command option.
>
> Error in ==> test at 5
>
> MATLAB:badopt
>
> Compiler Name version: MSVC 6
> ============================ test.m ==============================
> function y = test(N)
> tic;
> for i=1:10
> for j=1:10
> a=randn(N,N);
> b=randn(N,N);
> c=det(a);
> d=fft(b);
> e=a.*b;
>
> end
> end
> toc
>
| |
| mailcwc@gmail.com 2007-02-28, 7:14 pm |
| I use "test 1000" in the windows command line. In matlab, test(1000)
works just fine.
On Feb 28, 11:34 am, "Tom Lane" <t...@mathworks.com> wrote:[color=darkred]
> What input did you give to your test function? This can happen without the
> compiler as well:
>
>
> ??? Error using ==> randn
> Unknown command option.
>
> -- Tom
>
> <mail...@gmail.com> wrote in message
>
> news:1172677310.754040.277350@k78g2000cwa.googlegroups.com...
>
>
>
>
>
>
| |
| mailcwc@gmail.com 2007-02-28, 7:14 pm |
| I found out what's wrong. The argument is of char data type. After I
add N = str2num(N);, the problem is gone.
Thank you for reminding me this. Too , the test.m does not run
faster after compiling. But this still help me to run it on the
cluster.
On Feb 28, 11:34 am, "Tom Lane" <t...@mathworks.com> wrote:[color=darkred]
> What input did you give to your test function? This can happen without the
> compiler as well:
>
>
> ??? Error using ==> randn
> Unknown command option.
>
> -- Tom
>
> <mail...@gmail.com> wrote in message
>
> news:1172677310.754040.277350@k78g2000cwa.googlegroups.com...
>
>
>
>
>
>
|
|
|
|
|