Effacer les filtres
Effacer les filtres

Compiled executable doesn't recognize filter object (.m file works fine!)

1 vue (au cours des 30 derniers jours)
Ehsan
Ehsan le 15 Avr 2013
Hi there,
When I run the following as a .m file, everything works. But the compiled executable version doesn't work.
load data_mat % loads the 'data_seg' variable
load filter_specs % loads the 'custom' filter object
filteredData = filter(custom,data_seg);
The filter object 'custom' has been created like this: Hd_custom = fdesign.bandpass(120,130,4000,4010,60,1,60,40000); custom=design(Hd_custom,'cheby2'); save('filter_specs.mat','custom')
The error that I receive is this:
Warning: Variable 'custom' originally saved as a dfilt.df2sos cannot be instantiated as an object and will be read in as a cell. > In filter_exe at 4 ans = file: [1x87 char] name: 'filter_exe' line: 18 ans = Undefined function 'filter' for input arguments of type 'cell'.
This is what I get when I run ver:
------------------------------------------------------------------------------------------------------- MATLAB Version: 7.14.0.739 (R2012a) MATLAB License Number: •••••• Operating System: Microsoft Windows 7 Version 6.1 (Build 7601: Service Pack 1) Java Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot™ 64-Bit Server VM mixed mode ------------------------------------------------------------------------------------------------------- MATLAB Version 7.14 (R2012a) DSP System Toolbox Version 8.2 (R2012a) MATLAB Compiler Version 4.17 (R2012a) MATLAB Report Generator Version 3.12 (R2012a) Neural Network Toolbox Version 7.0.3 (R2012a) Parallel Computing Toolbox Version 6.0 (R2012a) Pattern Recognition Toolbox Version 3.0 (R2008a+) License unknown Signal Processing Toolbox Version 6.1 ----------------------
Any help would be greatly appreciated!

Réponses (2)

Navan Ruthramoorthy
Navan Ruthramoorthy le 18 Avr 2013
When an object is loaded from a .mat file compiler will not be able to analyze the dependencies needed to run the object saved in this .mat file. Try adding required functions using "%#function" in your code and then compiling it.
See documentation for %#function at http://www.mathworks.com/help/compiler/function.html.
Navan

Image Analyst
Image Analyst le 18 Avr 2013

Catégories

En savoir plus sur MATLAB Compiler dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by