gpt4 book ai didi

matlab - 可以在 MATLAB 中创建一个不返回任何内容的函数吗?

转载 作者:太空宇宙 更新时间:2023-11-03 19:07:17 25 4
gpt4 key购买 nike

我想编写一个函数来进行一些图像处理并将处理后的图像写入文件。我不希望它返回任何东西。我总是可以返回一个可以忽略的虚拟变量,但我想保持我的代码干净。我怎样才能在 MATLAB 中实现这一点?

最佳答案

是的。

function [] = my_awesome_function(image,filename,other_inputs)
% Do awesome things.
end

不会返回任何内容。一个更简单的版本:

function my_awesome_function(image,filename,other_inputs)
% Do awesome things.
end

是等价的。

关于matlab - 可以在 MATLAB 中创建一个不返回任何内容的函数吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12992619/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com