实验2大数据可视化处理实验
- 格式:doc
- 大小:169.50 KB
- 文档页数:14
科学计算与数据处理实验报告
Columns 1 through 9
0.2147 0.3243 0.5189 0.8216 1.0250 0.8292 0.5345 0.3489 0.2500
Columns 10 through 18
0.1995 0.1769 0.1730 0.1838 0.2071 0.2385 0.2673 0.2770 0.2584
Columns 19 through 27
0.2200 0.1775 0.1404 0.1112 0.0891 0.0725 0.0599 0.0502 0.0427
Columns 28 through 31
0.0367 0.0319 0.0280 0.0248
>> plot(n,y,'*')
(2)plot、subplot、axis、set、legend、xlabel、ylabel、zlabel、title、text、grid、box、hold、plotyy、fplot函数演示
>> x=0:0.1:5;
>> y=sin(x);
>> z=cos(x);
>> h=tan(x);
>> subplot(2,1,1);
>> plot(x,y);
>> subplot(2,1,2);
>> plot(x,z);
>> axis([0 4 0 20]);
>> h=plot(x,y);
>> set(h,'color','b');
>> set(gca,'XGrid','on','YGrid','off');
>> set(gca,'color','g');
>> clear
>> x=0:0.05:10;
>> plot(x,sin(x),'*b',x,cos(x),'+r',x,tan(x)./100,'+'); >> legend('sin','cos','tan');
>> clear
>> x=0:0.05:15;
>> plot3(x,sin(x),cos(x),'b','linewidth',1); >> xlabel('X');
>> ylabel('Y');
>> zlabel('Z');
>> title('三维曲线')
>> text(1,1,'图像示例')
>> grid('on')
>> box on
>> hold on
>> plot3(x,x.^2,x.^(1./2))
>> plot3(x,sin(x),cos(x),'b','linewidth',5); >> clear
>> x = 0:0.01:20;
>> y1 = 200*exp(-0.05*x).*sin(x);
>> y2 = 0.8*exp(-0.5*x).*sin(10*x);
>> [AX,H1,H2] = plotyy(x,y1,x,y2,'plot');
(3)实验演示plot3、mesh、surf函数
Plot3函数已在上面演示。
>> clear
>> z=peaks(25);
>> subplot(1,2,1);
>> mesh(z)
>> title('mesh函数');
>> subplot(1,2,2);
>> surf(z)
>> title('surf函数');
(4)实验演示面域图(area)、直方图(bar、barh、bar3、bar3h)、饼图(pie、pie3)、散点图(scatter、scatter3、plotmatrix)
>> x=magic(6);
>> area(x);
>> clear
>> x=0:0.2:2*pi;
>> y=sin(x);
>> subplot(2,2,1); >> bar(y);
>> title('bar');
>> subplot(2,2,2); >> barh(y);
>> title('barh'); >>Y=[1,2,3;4,5,6]; >> subplot(2,2,3); >> bar3(Y);
>> title('bar3'); >> subplot(2,2,4); >> bar3h(Y);
>> title('bar3h');
>> x=[1 2 3 4 5 6 7]; >> y=[0 0 0 1 0 0 0]; >> subplot(1,2,1); >> pie(x,y);
>> subplot(1,2,2); >> pie3([4 3 6 8 9]);
>> clear
>> a=rand(200,1);
>> b=rand(200,1);
>> c=rand(200,1);
>> scatter(a,b,100,c,'p')
>> clear
>> x=[1:10];
>> y=x+rand(size(x));
>> z=rand(size(x))+rand(size(y)); >> scatter3(x,y,z,'filled');
>> clear
>> x=randn(100,2);
>> plotmatrix(x)
(5)实验演示用view、rotate、colordef、colormap、shading、light、lighting、material、surfl等函数对三维图形进行精细控制的方法
>> clear
>> z=peaks(25);
>> colordef black;
>> colormap hot;
>> shading interp;
>> surfl(z)