开发者

How to capture an output from a function in MATLAB?

开发者 https://www.devze.com 2023-01-01 05:14 出处:网络
I have a simple function function increase(percent, number) low = number - number*percent; end 开发者_开发百科

I have a simple function

function increase(percent, number)

    low = number - number*percent;

end
开发者_开发百科

I want to return low so I can use it as an argument for another function

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

Is there a way to do this?


As such:

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

You can also return multiple items by having more than one thing to the left of the equal sign:

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

精彩评论

暂无评论...
验证码 换一张
取 消