matlab编程,计算多值的y=e^x,clc;clear;x=linspace(0,5,10);ep(1)=1;for i=1:5ep(i+1)=x.^(i)/factorial(i);endy=sum(ep);disp(y);plot(x,y,'*p');xlabel('x');ylabel('y');title('the function of y=e^x');legend('y=e^x');
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/28 19:10:57
matlab编程,计算多值的y=e^x,clc;clear;x=linspace(0,5,10);ep(1)=1;for i=1:5ep(i+1)=x.^(i)/factorial(i);endy=sum(ep);disp(y);plot(x,y,'*p');xlabel('x');ylabel('y');title('the function of y=e^x');legend('y=e^x');
matlab编程,计算多值的y=e^x,
clc;
clear;
x=linspace(0,5,10);
ep(1)=1;
for i=1:5
ep(i+1)=x.^(i)/factorial(i);
end
y=sum(ep);
disp(y);
plot(x,y,'*p');
xlabel('x');
ylabel('y');
title('the function of y=e^x');
legend('y=e^x');
matlab编程,计算多值的y=e^x,clc;clear;x=linspace(0,5,10);ep(1)=1;for i=1:5ep(i+1)=x.^(i)/factorial(i);endy=sum(ep);disp(y);plot(x,y,'*p');xlabel('x');ylabel('y');title('the function of y=e^x');legend('y=e^x');
clc;
clear;
x=linspace(0,5,10);
ep(1,:)=ones(size(x));
for i=1:5
ep(i+1,:)=x.^(i)/factorial(i);
end
y=sum(ep);
disp(y);
plot(x,y,'*-');
xlabel('x');
ylabel('y');
title('the function of y=e^x');
legend('y=e^x');
你的ep应当是一个矩阵.