我想编写一个执行某些图像处理的函数,并将处理后的图像写入文件。我不希望它返回任何东西。我总是可以返回一个可以忽略的虚拟变量,但我想保持我的代码干净。我怎样才能在MATLAB中实现这个目标?
答案 0 :(得分:50)
是
function [] = my_awesome_function(image,filename,other_inputs)
% Do awesome things.
end
什么都不会返回。一个更简单的版本:
function my_awesome_function(image,filename,other_inputs)
% Do awesome things.
end
等同。