hi, i need to run this code and plot it properly
Show older comments
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));
Accepted Answer
More Answers (0)
Categories
Find more on Just for fun in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!