Condition for choosing function
显示 更早的评论
Hello! I have this function:
function CL=coefficient(a)
where the input a is a scalar value and is periodic (from 0 to a max, from max to 0 and so on for a certein number of times). The maximum value (max) is variable, for example a can vary one time from 0 to 4 (and so from 4 to 0) and another from 0 to 15 (and so from 15 to 0) and so forth with different values of the maximum...
I have two different functions to define CL and I need to set the condition in order to obtain:
if a<10
CL=fun1(a)
if a>=10 (condition a=10 reached)
CL=fun2(a) even if the value of are going to be less then 10 ( when a varies from max to 0 maintain the function fun2(a)) .
When a=0 I need to reset all to have fun1(a).
How can I set this condition?
Thank you in advace!
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB Coder 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!