欢迎来到天天文库
浏览记录
ID:35342817
大小:96.99 KB
页数:16页
时间:2019-03-23
《实验八数据处理与多项式计算》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、实验八数据处理与多项式计算1.利用MATLAB提供的rand函数生成30000个符合均匀分布的随机数,然后检验随机数的性质:(1)均值和标准方差。(2)最大元素和最小元素。(3)大于0.5的随机数个数占总数的百分比。程序设计:A=rand(1,30000);aver=mean(A)sl=std(A)max=max(max(A))min=min(min(A))k=find(A>0・5);a=length(k);disp(r百分比是:!,per=a/30000运行结果:均值是:aver=0.4982si=0.2889max=1.0000min=
2、4.8158e-005百分比是:per二0.49882•将100个学生5门功课的成绩存入矩阵P中,进行如下处理:(1)分別求每门课的最高分、最低分及相应学生序号。(2)分别求每门课的平均分和标准方差。(3)5门课总分的最高分、最低分及相应学生序号。(4)将5门课总分按从大到小顺序存入zcj中,相应学生序号存入xsxho程序设计:A=45+(95-45)*rand(100,5);[Y,U]=max(A)[X,U]=min(A)运行结果:Y=94.972193.925094.514694.326594.5999948045148745.3517
3、45.692945.385145.090645.22794823272360(2)程序设计:A=45+(95-45)*rand(100,5);aver=mean(A)sl=std(A)运行结果:aver=67.187670.126269.001771.017470.3569si13.227314.130713.805315.119114.7097(3)程序设计:A=45+(95-45)*rand(100,5);B=sum(A,2)disp('最高分及学号:*),[Y,U]=max(B)dispC最低分及学号:’),[X,U]=min(B)运
4、行结果:最高分及学号:Y=432.6472U=84最低分及学号:X=287.6246U=50⑷程序设计:A=45+(95-45)*rand(100,5);B=sum(A,2);[X,I]二sort(B);zcj=flipud(X)xsxh=flipud(I)运行结果:zcj=411.6928402.4271399.1036395.5988395.0687394.7689392.5526390.1210390.0638389.1813388.5151384.5966384.1076383.9713383.3814382.6029382.424
5、7378.1633378.0461377.9044375.3540375.1321374.8964374.4653373.6161372.6935372.4896371.9191371.7079371.1875369.9678367.8567366.9795366.6455365.7516364.1375363.4540361.9467361.8567361.7840361.6956358.6729358.4628358.3555356.2759353.6687353.1473352.1761351.3823351.0567350.9925
6、350.3852349.0105348.5512347.8754347.3673346.4549344.7714343.9468343.7512343.7215343.2546342.9365341.6728340.8012340.1784339.9706339.5006338.6724336.2731335.3615330.1079329.5111329.2749328.1312327.4191326.8108325.6342324.2380320.4277320.2985319.8694318.0256317.2158316.70893
7、16.2008315.8376315.1794314.0229313.8373313.6161312.8490300.5995299.3519298.4068296.4909290.5062288.2487283.0271269.6334xsxh=3424907768815426936OO3352005700003Uj7$o53s£90029£o1a0065972009O3556Co003955003二g6200323、某气象观测站测得某日6:OOu8:00之间每隔2h的室内外温度(°C)如实验表1所示。实验表1室内外温度观测结果(X?)
8、时间h681012141618室内温度tl18.020.022.025.030.028.024.0室外温度t215.019.024.028.034.032.030.0试用三次样条
此文档下载收益归作者所有