文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > 高等教育 > 工学 > Stephen J.Chapman《MATLAB 编程(第二版) 》第四章
侵权投诉

Stephen J.Chapman《MATLAB 编程(第二版) 》第四章

Stephen J.Chapman《MATLAB 编程(第二版) 》第四章

3.2001年不是闰年。它的1月1号对应的day of year是30。这个程序5次运行后的结果分别为

>> doy

This program calculates the day of year given the current date.

Enter current month (1-12):1 Enter current day(1-31):1

Enter current year(yyyy): 1999

The date 1/ 1/1999 is day of year 1.

>> doy

This program calculates the day of year given the current date.

Enter current month (1-12):12 Enter current day(1-31):31 Enter current year(yyyy): 1999

The date 12/31/1999 is day of year 365.

>> doy

This program calculates the day of year given the current date.

Enter current month (1-12):1 Enter current day(1-31):1

Enter current year(yyyy): 2000

The date 1/ 1/2000 is day of year 1.

>> doy

This program calculates the day of year given the current date.

Enter current month (1-12):12 Enter current day(1-31):31 Enter current year(yyyy): 2000

The date 12/31/2000 is day of year 366.

>> doy

This program calculates the day of year given the current date.

Enter current month (1-12):3 Enter current day(1-31):1

Enter current year(yyyy): 2001

The date 3/ 1/2001 is day of year 60.

通过5次不同情况的检测,这个程序给出了正确的结果。

例4.4

统计分析

执行如下算法:

输入一系列的测量数,计算它们的平均数和标准差。这些数可以是正数,负数或0。 答案:

这个程序必须能够读取大量数据,并能够计算出这些测量值的平均数和标准差。这些测量值可以是正数,负数或0。

因为我们再也不能用一个数来表示数据中止的标识了,我们要求用户给出输入值的个

上一页第9页

你可能喜欢

热门文档

相关文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email