MATLAB: Error: Function definitions are not permitted in this context.

error: function definitions are not permitted in this context.

>> function [cim, r, c] = harris(im, sigma, thresh, radius, disp)
??? function [cim, r, c] = harris(im, sigma, thresh, radius, disp)
Error: Function definitions are not permitted in this context.
what is the problem. what will ı do?

Best Answer

You have to write your function in the Editor and save it as a function file (‘.m’) file. See the documentation on Function Basics for details.