用Matlab怎么画给定函数的图像呢?
x是取自随机数0~9的,得到一个方程k=4.6651-0.5074x^4+8.1055x^3-40.6303x^2+90.2343x;可是怎么画出他的曲线图呢?还可以得到...
x是取自随机数0~9的,得到一个方程k=4.6651-0.5074x^4+8.1055x^3-40.6303x^2+90.2343x;可是怎么画出他的曲线图呢?还可以得到另外两个曲线图,怎么把他们画在一张图上呢?万分感谢!急!急!急!
展开
展开全部
syms x x0
k=4.6651-0.5074*x.^4+8.1055*x.^3-40.6303*x.^2+90.2343*x
%subplot(m,n,i)生成m×n个子图窗口,i是每个窗口的index
%%%%%%%%%%%%%%%%%%%%%%%%%%
subplot(3,2,1);%1
ezplot(k);
hold on
x0=ceil(9*rand)
%k0=str2num(subs(k,x,x0))
plot(double(x0),subs(k,x,x0),'ro');hold off
%%%%%%%%%%%%%%%%%%%%%%%%%%
subplot(3,2,2);%2
ezplot('sin(x)'); %
%%%%%%%%%%%%%%%%%%%%%%%%%%
subplot(3,2,3);%3
ezplot('cos(x)');
%%%%%%%%%%%%%%%%%%%%%%%%%%
subplot(3,2,4);%4
ezplot('e^x');
%%%%%%%%%%%%%%%%%%%%%%%%%%
subplot(3,2,[5 6]);%第5和第6个窗口合并
%u=1:0.1:10
plot(1:0.1:10,tan(u),'b')
------------------------
你研究一下
k=4.6651-0.5074*x.^4+8.1055*x.^3-40.6303*x.^2+90.2343*x
%subplot(m,n,i)生成m×n个子图窗口,i是每个窗口的index
%%%%%%%%%%%%%%%%%%%%%%%%%%
subplot(3,2,1);%1
ezplot(k);
hold on
x0=ceil(9*rand)
%k0=str2num(subs(k,x,x0))
plot(double(x0),subs(k,x,x0),'ro');hold off
%%%%%%%%%%%%%%%%%%%%%%%%%%
subplot(3,2,2);%2
ezplot('sin(x)'); %
%%%%%%%%%%%%%%%%%%%%%%%%%%
subplot(3,2,3);%3
ezplot('cos(x)');
%%%%%%%%%%%%%%%%%%%%%%%%%%
subplot(3,2,4);%4
ezplot('e^x');
%%%%%%%%%%%%%%%%%%%%%%%%%%
subplot(3,2,[5 6]);%第5和第6个窗口合并
%u=1:0.1:10
plot(1:0.1:10,tan(u),'b')
------------------------
你研究一下
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询