全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 MATLAB等数学软件专版
1980 3
2008-02-12
本人在自学matlab, 有问题向高手求助,先谢了!

某地区人口增长情况如下(就是说,第0年人口为1,...第80年人口为1.890):
t=[0 10 25 50 75 80]
A=[1.000 1.080 1.201 1.375 1.75 1.890]

请按照要求写出相应的程序:

1. 对N(t)=a(0)+a(1)t+a(2)t^(2)+a(3)t^3使用polyniminal模型模拟:
(1) 使用polyniminal模型推导该地区第0年到第150年的人口;
(2) 绘图。将polyniminal模型的结果用solid red line 标注;将估计值用蓝色星号标准。要求添加相应的标题和横竖坐标名。

2. 使用polyfit函数模拟下面高阶函数的系数:
    N(t)=a(0)+a(1)t+...+a(g-1)t^(g-1)+a(g)t^g
(1)计算期为[0,150]。请写出相应的程序,要求能够计算任意阶数的相应值。
(2)对模拟值和实际值作图。
(3)当增加polynomial的阶数后发生了什么变化?


[em04]
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2008-2-13 23:22:00
谁能回答我的问题,版主给您奖励300金币。(见论坛首页上部)
难道真的没有人肯帮忙吗?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2008-2-15 23:52:00
这是我做的第一道题的答案,第二道题涉及到循环(loop)使用,看来不太好对付,希望专家指点!
--------

% the program is written for the Exl_1a
% the estimated polynomial function form is: N(t)=a_0+a_1*t+a_2*t^2+a_3*t^3+a_4*t^4
% show the estimated results in the figure

% "t" is year and "A" the population  
t=[0 10 25 50 75 85 ];
A=[1 1.08 1.201 1.475 1.750 1.890];
 
% Derive the population between 0 and 150 based on t and A
coeff=polyfit(t, A, 4);
eval_time=0:10:150;
Growth_function=polyval(coeff, eval_time);
% Plot the result of the polynomial and the measured values of the
% population in the same figure
plot(eval_time, Growth_function, 'r')
hold on
plot(t, A, '*b')
% add legend and title
legend('Result of polynominal','Measured Population')
xlabel('Year')
ylabel('Growth rate')
title('Population')

% end of the program
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2008-2-20 01:53:00
该收假了吧,高人在哪里?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群