Hello friends , whould you help me with this error?
1 次查看(过去 30 天)
显示 更早的评论
clc; close all;
picture=imread('LEAF_0120.jpg');
g=rgb2gray(picture);
subplot(3,3,1),imshow(g),title('original');
pic = edge(g,'sobel');
subplot(3,3,2),imshow(pic),title('sobel');
.......................................................................................................................
Error : Attempt to execute SCRIPT edge as a function
0 个评论
回答(1 个)
Walter Roberson
2021-4-28
picture=imread('flamingos.jpg');
g=rgb2gray(picture);
subplot(3,3,1),imshow(g),title('original');
pic = edge(g,'sobel');
subplot(3,3,2),imshow(pic),title('sobel');
... What this tells us is that you accidentally named the file of your code edge.m and so you conflicted with using MATLAB's edge() function.
2 个评论
Walter Roberson
2021-4-29
Inside a file named edge.m you asked MATLAB to call edge(g,'sobel') . How is MATLAB to know that that call to edge() was to be a call to the MATLAB edge(), and not an attempt to call your current file edge.m recursively ?
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!