【问题标题】:How to capture an output from a function in MATLAB?如何在 MATLAB 中捕获函数的输出?
【发布时间】:2010-05-25 21:43:41
【问题描述】:

我有一个简单的功能

function increase(percent, number)

    low = number - number*percent;

end

我想返回低电平,这样我就可以将它用作另一个函数的参数

mitoGen(asp, arg, increase(0.2, 234), glu)

有没有办法做到这一点?

【问题讨论】:

标签: matlab arguments


【解决方案1】:

这样:

function low = increase(percent, number)
  low = number - number*percent;
end

您还可以通过在等号左侧包含多个项目来返回多个项目:

function [out1, out2] = foo(bar, baz)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-10
    相关资源
    最近更新 更多