zoukankan      html  css  js  c++  java
  • 预测威海人口

    clc,clear
    %A=xlsread('populationdeal.xlsx');
    A=[
    1994    2412870    2.82
    1995    2424861    3.88
    1996    2435009    2.92
    1997    2445451    2.1
    1998    2454232    1.29
    1999    2459891    -0.11
    2000    2465894    -0.01
    2001    2470879    -0.98
    2002    2474197    -0.66
    2003    2476224    -3.35
    2004    2480079    -1.04
    2005    2487397    -1.36
    2006    2494602    -1.85
    2007    2504426    -0.36
    2008    2516430    -0.8
    2009    2525992    -1.17
    2010    2532870    -1.3
    2011    2537244    -1.59
    2012    2537076    -1.36
    2013    2536638    -0.99
    2014    2542513    2.54
        ];
    x=A(:,2);
    y=A(:,3)/100;
    a=polyfit(x,y,1);
    y1=x.*a(1)+a(2);
    hold on;
    subplot(1,2,1);
    plot(x,[y,y1]);
    xlabel('人口数'),ylabel('自然增长率');
    r0=a(2);
    xm=-a(2)/a(1);%求解最大环境容量
    x0=2542513;
    t=2:6;
    t1=t+2014;
    yf=xm./(1+(xm/x0-1)*exp(-r0*t));
    subplot(1,2,2);
    plot(t1,yf);
    xlabel('年份'),ylabel('预计人口数');
    
    yf
  • 相关阅读:
    小猫爬山
    方格取数
    Bash 脚本编程
    树链剖分学习笔记
    输入输出优化
    没有上司的舞会
    线性dp 之 麻烦的聚餐
    飞翔
    挖地雷
    The Prices
  • 原文地址:https://www.cnblogs.com/weiweiyi/p/5479283.html
Copyright © 2011-2022 走看看