资源描述:
《重庆大学--数学实验-温罗生.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、重庆大学学生实验报告实验课程名称数学实验开课实验室DS1404学院2014年级电子科学与技术专业班01学生姓名学号开课时间2016学年第2学期总成绩教师签名数学与统计学院制开课学院、实验室:DS1404实验时间:2016年3月10日课程名称数学实验实验项目名称实验项目类型验证演示综合设计其他指导教师温老师成绩1.代码x=3.14;y1=sign(x);y2=x^3;y3=sin(x);y4=cos(x);y5=tan(x^2);y6=2*tan(x);y7=3^x;y8=log(abs(x-x^x));y9=log2(x)/log2(3);y10=fi
2、x(x);y11=asin(x^2-3*pi);y12=x^(1/6);y13=sqrt(2*x^2+(4*x/(log(x+exp(x)*sin(x))/2*x^2)));y=[y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13];y结果y=1.000030.95910.0016-1.00000.4645-0.003231.48913.50251.04153.00000.44981.21014.68222.代码y=rand(5,10)max(y),max(y,[],2)min(y),max(y,[],2)sum(y)
3、sort(y)length(y)size(y)说明:rand(x)随机产生矩阵,max(y)求取矩阵y每一行最大值,max(y,[],2)求取矩阵y每一列最大值;其中min(y)类似。sum(y)相应的与max(y)相似的用法,表示求矩阵每一行或每一列的和;这几个函数在用法上大体一致,只是实现的功能有所不同而已。结果y=0.42290.69990.53090.96860.77880.28100.51810.67610.25480.78050.09420.63850.65440.53130.42350.44010.94360.28910.22400.67
4、530.59850.03360.40760.32510.09080.52710.63770.67180.66780.00670.47090.06880.82000.10560.26650.45740.95770.69510.84440.60220.69590.31960.71840.61100.15370.87540.24070.06800.34450.3868ans=0.69590.69990.82000.96860.77880.87540.95770.69510.84440.7805ans=0.96860.94360.67180.95770.875
5、4ans=0.09420.03360.40760.10560.09080.28100.24070.06800.22400.0067ans=0.96860.94360.67180.95770.8754ans=2.28251.76043.13132.54171.71322.58103.29782.40012.33552.4515ans=0.09420.03360.40760.10560.09080.28100.24070.06800.22400.00670.42290.06880.53090.32510.15370.44010.51810.28910.25
6、480.38680.47090.31960.65440.53130.26650.45740.63770.67180.34450.60220.59850.63850.71840.61100.42350.52710.94360.67610.66780.67530.69590.69990.82000.96860.77880.87540.95770.69510.84440.7805ans=103.代码(n阶行列式)function[u,v]=DET(x,y)A=rand(x);u=det(A);v=0;fori=1:xa=A;a(y,:)=[];a(:,i)=
7、[];v=A(y,i)*det(a)*(-1)^(y+i)+v;endend(下面任意选取n阶行列式进行验证,例如四阶行列式)结果:[u,v]=DET(4,2)u=-0.0261v=-0.02614.代码x=-10:0.1:10;y=exp(-((x-2).^2)/4);subplot(2,2,1);plot(x,y);theta=-pi:0.1:pi;rou=sin(3.*theta);subplot(2,2,2);plot(theta,rou);t=-10:0.1:10;y1=(3*t)./(1+t.^3);y2=(3*t.^2)./(1+t.^3
8、);subplot(2,2,3);plot(y1,y2);subplot(2,2,4);ezp