MATLAB中函数my_fun(x)的限制条件是两个等式,该怎么编写?各位大神求救啊!万分感谢function z=my_fun(x)x=0:.1:100;if (x(1)+x(2)+x(3)+x(4)==100)&&(0.8*x(2).*x(2)+1.9*x(3).*x(3)+2.2*x(4).*x(4)+0.8*x(1).*x(2)+2.2*x(2).*x(3)+1.6*x(1
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/04 11:44:40
![MATLAB中函数my_fun(x)的限制条件是两个等式,该怎么编写?各位大神求救啊!万分感谢function z=my_fun(x)x=0:.1:100;if (x(1)+x(2)+x(3)+x(4)==100)&&(0.8*x(2).*x(2)+1.9*x(3).*x(3)+2.2*x(4).*x(4)+0.8*x(1).*x(2)+2.2*x(2).*x(3)+1.6*x(1](/uploads/image/z/11503338-42-8.jpg?t=MATLAB%E4%B8%AD%E5%87%BD%E6%95%B0my_fun%28x%29%E7%9A%84%E9%99%90%E5%88%B6%E6%9D%A1%E4%BB%B6%E6%98%AF%E4%B8%A4%E4%B8%AA%E7%AD%89%E5%BC%8F%2C%E8%AF%A5%E6%80%8E%E4%B9%88%E7%BC%96%E5%86%99%3F%E5%90%84%E4%BD%8D%E5%A4%A7%E7%A5%9E%E6%B1%82%E6%95%91%E5%95%8A%21%E4%B8%87%E5%88%86%E6%84%9F%E8%B0%A2function+z%3Dmy_fun%28x%29x%3D0%3A.1%3A100%3Bif+%28x%281%29%2Bx%282%29%2Bx%283%29%2Bx%284%29%3D%3D100%29%26%26%280.8%2Ax%282%29.%2Ax%282%29%2B1.9%2Ax%283%29.%2Ax%283%29%2B2.2%2Ax%284%29.%2Ax%284%29%2B0.8%2Ax%281%29.%2Ax%282%29%2B2.2%2Ax%282%29.%2Ax%283%29%2B1.6%2Ax%281)
MATLAB中函数my_fun(x)的限制条件是两个等式,该怎么编写?各位大神求救啊!万分感谢function z=my_fun(x)x=0:.1:100;if (x(1)+x(2)+x(3)+x(4)==100)&&(0.8*x(2).*x(2)+1.9*x(3).*x(3)+2.2*x(4).*x(4)+0.8*x(1).*x(2)+2.2*x(2).*x(3)+1.6*x(1
MATLAB中函数my_fun(x)的限制条件是两个等式,该怎么编写?各位大神求救啊!万分感谢
function z=my_fun(x)
x=0:.1:100;
if (x(1)+x(2)+x(3)+x(4)==100)&&(0.8*x(2).*x(2)+1.9*x(3).*x(3)+2.2*x(4).*x(4)+0.8*x(1).*x(2)+2.2*x(2).*x(3)+1.6*x(1).*x(3)+2.2*x(1).*x(4)+2.6*x(2).*x(4)+3.2*x(3).*x(4)==1.5)
z=-3.5*x(1)-4.4*x(2)-5.3*x(3)-6.2*x(4)
end
函数my_fun(x)的限制条件是两个等式,该怎么编写?
MATLAB中函数my_fun(x)的限制条件是两个等式,该怎么编写?各位大神求救啊!万分感谢function z=my_fun(x)x=0:.1:100;if (x(1)+x(2)+x(3)+x(4)==100)&&(0.8*x(2).*x(2)+1.9*x(3).*x(3)+2.2*x(4).*x(4)+0.8*x(1).*x(2)+2.2*x(2).*x(3)+1.6*x(1
同学你好!你这样写当然可以咯.
只是才四个数,可能返回的只有一个数值