After running the following code I am getting this error in the pol2cart function
[srad,sang,S] = specxture(f);function [ srad, sang, S] = specxture( f )S = fftshift(fft2(f));%imtool (S);
S = abs(S);%imshow(S,[]);
[M, N] = size(S);x0 =uint8(M/2+1);%x0=int16(x0);
y0 =uint8(N/2+1);%y0=int16(y0);
rmax = uint8((min(M, N)/2)-1);%rmax1=int16(rmax);
srad = zeros(1, rmax);srad(1) = S(x0, y0);%imtool (S);for r = 2:rmax [xc, yc] = halfcircle(r, x0, y0); srad(r) = sum(S(sub2ind(size(S), xc, yc)));end[xc, yc] = halfcircle(rmax, x0, y0);sang = zeros(1, length(xc));for a = 1:length(xc) [xr, yr] = radial(x0, y0, xc(a), yc(a)); sang(a) = sum(S(sub2ind(size(S), xr, yr)));endS = mat2gray(log(1+S));endfunction [xc, yc] = halfcircle(r, x0, y0) theta = 91:270; theta = double(theta*pi/180); [xc, yc] = pol2cart(theta, r); xc = round(xc)'+x0; yc = round(yc)'+y0;function [x,y,z] = pol2cart(th,r,z)x = r.*cos(th);y = r.*sin(th);
Best Answer