您当前的位置:首页 >> 最新 >  >> 
matlab 编写分段函数_matlab构造分段函数
来源: 互联网      时间:2023-05-17 21:10:28


(相关资料图)

1、应该这样写:function main()clc;x = 12;fx = ceshi_fun(x)function fx = ceshi_fun(x)if nargin < 1 x = 1;endif x ~= 10 fx = x*sqrt(x+sqrt(x));else fx = cos(x+1)+sqrt(x^2+1);end结果:fx = 47.1893。

本文到此分享完毕,希望对大家有所帮助。

标签:

X 关闭

X 关闭