MATLAB: Radon transform error.

Image Processing Toolboxoverriding built-in functionradon

Hi Community,
Here is the script I have written:
f_sample = @(x) double(2*(x(1)^2 + x(2)^2) < 1);
x = -1:0.1:1;
[X,Y] = meshgrid(x);
Z = zeros(size(X));
for i = 1:length(x)
for j = 1:length(x)
Z(i,j) = f_sample([X(i,j);Y(i,j)]);
end
end
New_Phantom = Z;
R = radon(New_Phantom,0:0.1:179);
BackProjected_Radon = iradon(R,0:0.1:179);
R = R - min(min(R));
R = R/max(max(abs(R)));
BackProjected_Radon = BackProjected_Radon - min(min(BackProjected_Radon));
BackProjected_Radon = BackProjected_Radon/max(max(abs(BackProjected_Radon)));
When I run the script, I get the following error:
Attempt to execute SCRIPT radon as a function:
C:\Users\micha\Documents\MATLAB\radon.m
Error in radon (line 19)
R = radon(New_Phantom,0:0.1:179);
I understand that the radon function takes a 2-D image and outputs the image transform. I do not see where I am going wrong. Unless i am misinterpreting the format of my input, it should be able to perform this without issue.
Thank you in advance!

Best Answer

You named your script radon.m but inside the script named radon.m you expect radon() to refer to MATLAB's toolbox/images/images/radon.m .
You need to rename your script so that it is not the same as any function that needs to be called in computing your script.
Related Question