MATLAB Answers

angel
0

plz help me sorting the error...

Asked by angel
on 13 Apr 2013

the code i wrote is:

S(y,x)=0.125*f(y,mod(x-p-2,N)+1)+...
                 0.375*f(y,x)+...
                 0.375*f(y,mod(x+p,N)+1)+...
                 0.125*f(y,mod(x+p*2+1,N)+...
                 0.125*f(mod(y-p-2,N)+1,x)+...
                 0.375*f(y,x)+...
                 0.375*f(mod(y+p,N)+1,x)+...
                 0.125*f(mod(y+p*2+1,N)+1,x));

here f() corresponds to my input image

error shown is:

   Attempted to access f(1,169.125); index must be a positive integer or logical.
 Error in dyadicAnalysis (line 29)
            S(y,x)=0.125*f(y,mod(x-p-2,N)+1)+...

here p=2^j-1; where j is a loop variable starts from 1 and end at log(N)/log(2)

N=sizef(1), sizef=size(f);

can anybody tell me what is the problem in it? i've tried floor but the error remains the same

  0 Comments

Tags

Products

No products are associated with this question.

1 Answer

Answer by Image Analyst
on 13 Apr 2013
 Accepted answer

There is no 169.125'th element of a matrix. You can access element # 169 or 170, but if you want to get 169.125 then you'll have to do interpolation.

  11 Comments

the problem is in the last line sir

 imshow(S,256)
Error using imshow>preParseInputs (line 385)
The syntax IMSHOW(I,N) has been removed.
 Error in imshow (line 194)
  varargin_translated = preParseInputs(varargin{:});
 Error in dyadicAnalysis (line 56)
imshow(S,256);
 385     error(message('images:removed:syntaxNoReplacement','IMSHOW(I,N)'))
K>> 

Modify your code to

imshow(S, [])

thank u so much sir.......


Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!