如何用Matlab画含积分函数式子的图形syms x1 Q_N;p = 125; w = 80; w2 = 85; c = 35; c2 = 50; v = 20; h = 10; a = 130; b = 1;rate = [10 12 28 22 18 10];demand = 5500:200:6500;r = sum(rate); AVG = rate * demand'/r

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/05 04:30:50
如何用Matlab画含积分函数式子的图形syms x1 Q_N;p = 125; w = 80; w2 = 85; c = 35; c2 = 50; v = 20; h = 10; a = 130; b = 1;rate = [10 12 28 22 18 10];demand = 5500:200:6500;r = sum(rate);                AVG = rate * demand'/r

如何用Matlab画含积分函数式子的图形syms x1 Q_N;p = 125; w = 80; w2 = 85; c = 35; c2 = 50; v = 20; h = 10; a = 130; b = 1;rate = [10 12 28 22 18 10];demand = 5500:200:6500;r = sum(rate); AVG = rate * demand'/r
如何用Matlab画含积分函数式子的图形
syms x1 Q_N;
p = 125; w = 80; w2 = 85; c = 35; c2 = 50; v = 20; h = 10; a = 130; b = 1;
rate = [10 12 28 22 18 10];
demand = 5500:200:6500;
r = sum(rate);
AVG = rate * demand'/r
STD = sqrt(rate * (demand.^2)'/r - AVG^2)
n = (p + 2 * h - c)/(p - v + 2 * h);
y(p) = a * p ^ (- b);
Q_N = 4000:500:8000;
S1 = (1 -normcdf(Q_N/y(p),AVG,STD)) .* Q_N
f_x=(exp(-(x1-AVG)^2/(2*STD^2)))/(sqrt(2*pi)*STD);
S2 = int(x1 * f_x,0,Q_N/y(p))
Es = S1 + S2;
es = eval(Es)
Eb = int((Q_N - x1) * f_x,0,Q_N/y(p));
eb=eval(Eb)
El = AVG - es
if El > 0
el = El
else
el = 0
end
Er = - w * Q_N + p * Es + v * Eb - h * el;
er=eval(Er)
ew = (w - c) * Q_N - h * el
e = er + ew
plot(Q_N,er)
hold on
plot(Q_N,ew)
hold on
plot(Q_N,e)
是新手,不太懂,要画随着Q_N取值变化,er,ew,e的相应变化图像.以上程序调试出现:
Error using mupadmex
Error in MuPAD command: The argument is invalid. [Dom::Interval::new]
Error in sym/int (line 124)
rSym = mupadmex('symobj::intdef',f.s,x.s,a.s,b.s,options);
恳请大神指教.谢谢!
(打酱油的外行请绕道)

如何用Matlab画含积分函数式子的图形syms x1 Q_N;p = 125; w = 80; w2 = 85; c = 35; c2 = 50; v = 20; h = 10; a = 130; b = 1;rate = [10 12 28 22 18 10];demand = 5500:200:6500;r = sum(rate); AVG = rate * demand'/r
为什么我能运行出来,图像如下: