MATLAB: How to ”Function definitions are not permitted in this context” can be corrected

function definitions are not permitted in this context.

this is my code..after i run this code, it says that function b = my_imresize(a,m,n) – Error: Function definitions are not permitted in this context. what should i do?

Best Answer

You store the code in a file named my_imresize.m