没有输入的m文件是可以直接运行的。function a=myfun(b)不能直接运行的原因是没有给定输入b。此时,将function a=myfun(b)删掉,直接给出b。如果后面有:function...end的结构,删掉function对应的end即可直接运行。