用matlab创建数列 an=n^4 1

来源:学生作业帮助网 编辑:作业帮 时间:2024/06/09 13:42:20

用matlab创建数列 an=n^4 1

第一个代码:
t=1:50;
an=zeros(1,50);
for n=1:50
an(n)=n^4;
end
plot(t,an);
grid on;
第二个代码
clc;clear all;
x=1:50;
fx=zeros(1,50);
for t=1:50
fx(t)=1/(1+t^3);
end
plot(x,fx);
grid on;