dwt3d instruction returns with error saying filter H must be a double precision filter

when i try to run the following example code for dwt3D

    [af, sf] = farras;
    x = rand(128,64,64);
    w = dwt3D(x,3,af);
    y = idwt3D(w,3,sf);
    err = x-y; 
    max(max(max(abs(err))))

i get an error saying

Error using upfirdn>validateinput (line 104)
The filter H must be a double-precision vector.
Error in upfirdn (line 81)
[p,q] = validateinput(x,h,varargin);
Error in afb3D_A (line 41)
   lo(:, :, k) = upfirdn(x(:, :, k), lpf, 1, 2);
Error in afb3D (line 36)
[L, H] = afb3D_A(x, af1, 1);
Error in dwt3D (line 27)
    [x w{k}] = afb3D(x, af, af, af);

i have all the required function files with me in the current folder of MATLAB

10 Comments

yes tried that but it did not work. adding a image of the error
can you attach the dwt3D.m and afb3D.m files?
thank you have been trying using the same function files but doesn't run on my matlab R2017b or R2013a

I just tested in both R2017b and R2013a, and the code works fine for me.

After you execute that first line of code,

    [af, sf] = farras;

what shows up for

 class(af)

? It should show up as double(), and if it does not then you are not using the farras.m that is provided with the code.

when i execute class(af) i get it as 'cell' not double

Sign in to comment.

 Accepted Answer

Conflicting versions of the data loading function caused this error. The required data is in the form of numeric arrays; the data loading function was returning a cell array instead.

More Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!