hi, i need to run this code and plot it properly
显示 更早的评论
clear all;
clc;
close all;
u=[2 0 1 5 1 7 4 3 3];
n=max(u);
m=mean(u);
syms x p;
p=1200;
y=@(x)(x*(p-3*x));
gy=ezplot(y);
hold on
grid on
df=diff(y(x),1);
xin=solve(y(x));
xint=[xin,zeros(length(xin),1)];
yin=[0,y(0)];
plot(xint(:,1),xint(:,2),'+');
plot(yin(:,1),yin(:,2),'+');
hold on
crit=solve(df);
critp=[crit,y(crit)];
plot(critp(:,1),critp(:,2))
hold on
dff=diff(y(x),2);
inf=solve(dff);
infp=[inf,y(inf)];
plot(infp(:,1),infp(:,2));
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!