Radon transform error.
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Michael Agustin Mateo
il 30 Set 2020
Commentato: Michael Agustin Mateo
il 1 Ott 2020
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!
0 Commenti
Risposta accettata
Walter Roberson
il 1 Ott 2020
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.
Più risposte (0)
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!