How to make MATLAB stand-alone application?
3 views (last 30 days)
Show older comments
I have a small Matlab m file which uses matlab signal processing toolbox, it basically is filtering noise from my signals. I want to run it outside MatLab environment. How can I make it an exe file so that I can run it in dos?
here is my m file
[b,a] = butter(9,.02,'low'); x=textread('noisy.out'); y=filter(b,a,x); save filtered.out y -ASCII
my compiler is
Lcc C version 2.4 in
when I run the following command
mcc -m myfilter.m -o mehdi
to make exe file I get the following error
Error: File "myfilter" is a script M-file and cannot be compiled with the current Compiler.
please help me how I can resolve this problem?
0 Comments
Answers (1)
Walter Roberson
on 7 Mar 2011
At the top of your file, you need to add
function myfilter
to convert it from a script in to a function.
Note: I seem to recall that filter design was one of the things you are not allowed to compile, so I don't know if you will be able to compile calls to butter() .
4 Comments
Kaustubha Govind
on 11 Mar 2011
As Walter suggested, you need:
function myfilter
[b,a] = butter(9,.02,'low'); x=textread('noisy.out'); y=filter(b,a,x); save filtered.out y -ASCII
It doesn't seem like you've added function myfilter to the top of your script to convert it to a function.
@Walter: MATLAB Compiler should support the BUTTER function (see http://www.mathworks.com/products/compiler/compiler_support.html)
See Also
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!