⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shili61.m

📁 MATLAB实例编程一百个源程序,这里面有图象处理,数值计算等.
💻 M
字号:
h0=figure('toolbar','none',...
    'position',[198 56 450 468],...
    'name','实例61');
h1=axes('parent',h0,...
    'position',[0.3 0.45 0.5 0.5],...
    'visible','off');
[x,y,z,v]=flow;
xmin=min(x(:));
ymin=min(y(:));
zmin=min(z(:));
xmax=max(x(:));
ymax=max(y(:));
zmax=max(z(:));
u1=uimenu('parent',h0,...
    'tag','u1',...
    'label','绘图',...
    'background',[0.75 0.75 0.75]);
u11=uimenu('parent',u1,...
    'tag','u11',...
    'label','绕X轴旋转-45度',...
    'background',[0.75 0.75 0.75],...
    'callback',[...
        'cla,',...
        'hslice=surf(linspace(xmin,xmax,100),linspace(ymin,ymax,100),zeros(100));,',...
        'rotate(hslice,[-1,0,0],-45),',...
        'xd=get(hslice,''xdata'');,',...
        'yd=get(hslice,''ydata'');,',...
        'zd=get(hslice,''zdata'');']);
u12=uimenu('parent',u1,...
    'tag','u12',...
    'label','绕Y轴旋转-45度',...
    'background',[0.75 0.75 0.75],...
    'callback',[...
        'cla,',...
        'hslice=surf(linspace(xmin,xmax,100),linspace(ymin,ymax,100),zeros(100));,',...
        'rotate(hslice,[0,-1,0],-45),',...
        'xd=get(hslice,''xdata'');,',...
        'yd=get(hslice,''ydata'');,',...
        'zd=get(hslice,''zdata'');']);
b1=uicontrol('parent',h0,...
    'style','pushbutton',...
    'units','points',...
    'tag','b1',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'string','设置颜色',...
    'position',[50 120 60 25],...
    'callback',[...
        'delete(hslice),',...
        'h=slice(x,y,z,v,xd,yd,zd);,',...
        'set(h,''facecolor'',''interp'',''edgecolor'',''none'',''diffusestrength'',0.8)']);
b2=uicontrol('parent',h0,...
    'style','pushbutton',...
    'units','points',...
    'tag','b2',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'string','添加切片1',...
    'position',[240 120 60 25],...
    'callback',[...
        'hold on,',...
        'hx=slice(x,y,z,v,xmax,[],[]);,',...
        'set(hx,''facecolor'',''interp'',''edgecolor'',''none'')']);
b3=uicontrol('parent',h0,...
    'style','pushbutton',...
    'units','points',...
    'tag','b3',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'string','添加切片2',...
    'position',[240 70 60 20],...
    'callback',[...
        'hold on,',...
        'hy=slice(x,y,z,v,ymax,[],[]);,',...
        'set(hy,''facecolor'',''interp'',''edgecolor'',''none'')']);
b4=uicontrol('parent',h0,...
    'style','pushbutton',...
    'units','points',...
    'tag','b4',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'string','添加切片3',...
    'position',[240 20 60 20],...
    'callback',[...
        'hold on,',...
        'hz=slice(x,y,z,v,zmax-1,[],[]);,',...
        'set(hz,''facecolor'',''interp'',''edgecolor'',''none'')']);
b5=uicontrol('parent',h0,...
    'style','pushbutton',...
    'units','points',...
    'tag','b5',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'string','灯光效果',...
    'position',[50 70 60 20],...
    'callback',[...
        'daspect([1 1 1]),',...
        'axis tight,',...
        'box on,',...
        'view(-38.5,16),',...
        'camzoom(1.4),',...
        'camproj perspective,',...
        'lightangle(-45,45)']);
b6=uicontrol('parent',h0,...
    'style','pushbutton',...
    'units','points',...
    'tag','b6',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'string','colorbar',...
    'position',[50 20 60 20],...
    'callback','colorbar(''horiz'')');
b7=uicontrol('parent',h0,...
    'style','pushbutton',...
    'units','points',...
    'tag','b7',...
    'backgroundcolor',[0.75 0.75 0.75],...
    'string','关闭',...
    'fontsize',14,...
    'position',[145 75 60 20],...
    'callback','close');

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -