Attempt to execute SCRIPT rot90 as a function:

조회 수: 1 (최근 30일)
vetri veeran
vetri veeran 2014년 10월 24일
답변: Image Analyst 2014년 10월 24일
img = imread('cameraman.jpg');
imshow(img);
img1 = imnoise(img,'salt & pepper', 0.02);
figure,imshow(img1)
vet=fspecial('average');
vet1=filter2(vet,img1)
I got this error:
Attempt to execute SCRIPT rot90 as a function:
D:\MATLAB\homework\rot90.m
Error in filter2 (line 39)
stencil = rot90(b,2);
Error in filt (line 9)
vet1=filter2(vet,img1)
Can anyone help me in this regard? Thank you.

채택된 답변

Image Analyst
Image Analyst 2014년 10월 24일
It looks like you wrote your own rot90 function and saved it as "D:\MATLAB\homework\rot90.m" but it looks like your filt.m program calls filter2() (a built in function) and that function calls rot90. I think it's getting confused as to which version of rot90 it should run. What does this say:
which -all rot90
Then rename your rot90.m to something different so that filter2 will call the built-in one from the Mathworks like it expects to.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by