Hello friends , whould you help me with this error?

1 回表示 (過去 30 日間)
eltaf kazemi
eltaf kazemi 2021 年 4 月 28 日
コメント済み: Walter Roberson 2021 年 4 月 29 日
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

回答 (1 件)

Walter Roberson
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 件のコメント
eltaf kazemi
eltaf kazemi 2021 年 4 月 28 日
ok thank you ...
but why it dont show me the edge plot?
Walter Roberson
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 ?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by