求解答:matlab中分段函数问题symsuf=-2*u.^4+2*u.^2+u/6+0.3;ifu>=(-0.9-f(-0.9))&u<=(-0.9)g=0.9+u+f(-0.9);elseifu>=(-0.9)&u<=1g=f;elseifu>=1&u<=(1+f(1))g=1-u-f(1);end
syms u
f=-2*u.^4+2*u.^2+u/6+0.3;
if u >= (-0.9-f(-0.9)) & u <= (-0.9)
g =0.9+u+f(-0.9);
else if u>=(-0.9) & u<=1
g=f;
else if u>=1 & u<=(1+f(1))
g=1-u-f(1);
end
end
end
求大神帮忙看看哪里出错了?是分段函数写的不对还是 syms 的缘故?
>> f = @(u) -2*u.^4+2*u.^2+u/6+0.3;
>> g = @(u) (u>= -0.9-f(-0.9) & u <= -0.9).*(0.9 + u+f(-0.9)) + (u>= -0.9 & u<=1).*f(u) + (u>=1 & u<=1+f(1)).*(1-u-f(1))
g =
@(u)(u>=-0.9-f(-0.9)&u<=-0.9).*(0.9+u+f(-0.9))+(u>=-0.9&u<=1).*f(u)+(u>=1&u<=1+f(1)).*(1-u-f(1))
>> plot(linspace(-1,1,100),g(linspace(-1,1,100)))
解个六元六次方程组..2(x-u)+2λx=02(y-v)+2λ=0-2(x-u)+2ua-5a= 2020-04-25 …
求解答:matlab中分段函数问题symsuf=-2*u.^4+2*u.^2+u/6+0.3;if 2020-05-12 …
A= (2 0 0) B=(1 0 0)(0 a 2) (0 2 0)(0 2 3) (0 0 b 2020-05-16 …
Matlab;已知u=0:0.1:1;△u=[0.100.1210.130.1410.150.16 2020-06-05 …
大一数学分析,度量空间相关,求闭包A={(0,0)}U{(x,y)∈R^2:y=sin(1/x), 2020-06-11 …
求助u=u2(x)u2(y)u2(z)ABBCCA)/2=0求助u=u2(x)u2(y)u2(z) 2020-06-11 …
已知三维线性空间的一组基底为A1=(1,1,0),A2(1,0,1),A3=(0,1,1),则向量 2020-06-26 …
用matlab画一个函数的三维图像。sqrt(u^2+v^2)d0时,h=0,画出h与u、v的三维 2020-07-09 …
概率论中X~U(0,2)说明x的取值范围是(0,2),N(0,1)说明x的取值范围是负无穷到正无穷 2020-07-22 …
1.设[f(x)-e^x]sinydx-f(x)cosydy是一个二元函数的全微分,且f(x)具有一 2020-11-07 …