24小时热门版块排行榜    

查看: 526  |  回复: 2

strive123123

禁虫 (文坛精英)

本帖内容被屏蔽

已阅   关注TA 给TA发消息 送TA红花 TA的回帖

dbb627

荣誉版主 (著名写手)

【答案】应助回帖

strive123123(金币+1): 2011-11-20 15:43:38
先给一个画隐含数图像的函数
CODE:
function h=implicitmesh(f,xlimit,ylimit,zlimit,gd)
%implicitmesh(f,span,gd):画隐函数曲面f(x,y,z)=0的网格图,
%                          各坐标范围均限定在span=[lb,ub],
%                          网格数为gd,默认为25
%implicitmesh(f,xspan,yspan,zspan,gd):画隐函数曲面f(x,y,z)=0,
%                          各坐标范围分别限定在xspan,yspan,zspan
%h=implicitmesh(...):画隐函数曲面并输出句柄
%例一:
%implicitmesh(inline('x.*y+z.^2'),[-5 5])%注意*\^一定要设成点运算
%例二:
%f=@(x,y,z)x.^2+y.^2+0*z-1;%注意如果f中不含某个变量一定要加上诸如0*y的项。
%implicitmesh(f,[-1 1],10)
%例三:
%f=@(x,y,z)(x.^2 + (9/4)*y.^2 + z.^2 - 1).^3 - x.^2.*z.^3 - (9/80)*y.^2.*z.^3;
%g=@(x,y,z)(sqrt(x.^2+y.^2)-2).^2+z.^2-.09;
%implicitmesh(f,[-1.5 1.5],[-.8 .8],[-1.5 1.5],50);
%hold on%可以添加图形
%h=implicitmesh(g,[-2.3,2.3]);
%colormap hsv;set(h,'facecolor','none');%可以设置各种效果
%axis off;axis equal;
if nargin==2
    ylimit=xlimit;zlimit=xlimit;gd=25;
elseif nargin==3
    gd=ylimit;ylimit=xlimit;zlimit=xlimit;
elseif nargin==4
    gd=25;
elseif nargin==5
else
    error('Error in input arguments')
end
x=linspace(xlimit(1),xlimit(2),gd);
y=linspace(ylimit(1),ylimit(2),gd);
z=linspace(zlimit(1),zlimit(2),gd);
[x,y,z]=meshgrid(x,y,z);val=f(x,y,z);
[f,v]=isosurface(x,y,z,val,0);
if isempty(f)
    warning('There is no graph in the range.');
    p=[];
else
    newplot;
    p=patch('Faces',f,'Vertices',v,'CData',v(:,3),'facecolor','w','EdgeColor','flat');
    isonormals(x,y,z,val,p);view(3);grid on
end
if nargout==0
else
    h=p;
end

做图命令
CODE:
syms x k1 k2
a=6.2724; r=0.0797; q=0.6898; g=6.2724;
f=x.^4 +(k1+k2+q)*x.^3 +( (k1+k2)*q+(a+g)*r )*x.^2 +( (k1+k2)*r*a+(a+k2)*r*g )*x +k1*k2*r*a;
f=@(x,k1,k2)eval(f)
implicitmesh(f,[-10 10],[-.8 .8],[-1.5 1.5],50);
xlabel('x');ylabel('k1');zlabel('k2');
shading interp



The more you learn, the more you know, the more you know, and the more you forget. The more you forget, the less you know. So why bother to learn.
2楼2011-11-20 12:02:07
已阅   关注TA 给TA发消息 送TA红花 TA的回帖

strive123123

禁虫 (文坛精英)

本帖内容被屏蔽

3楼2011-11-20 15:44:50
已阅   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 strive123123 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 应该是93bebmhtak前后十一个字符比较关键 +17 Lanmanbaby 2026-08-09 29/1450 2026-08-12 00:24 by zhanghaozhu
[基金申请] 奇怪,两个人的filecode固定段从头到尾一模一样 +7 布布和一二 2026-08-10 9/450 2026-08-11 22:12 by 医学老男孩
[基金申请] 是这周出结果还是下周出结果? +3 yuleib84 2026-08-11 3/150 2026-08-11 21:53 by jnhyjjm
[基金申请] 为什么网上很多人说本周 12号出结果 +6 瞬息宇宙 2026-08-10 7/350 2026-08-11 19:25 by Tide man
[基金申请] 分享一下我之前已中青C的计划书的filecode +3 布布和一二 2026-08-11 4/200 2026-08-11 15:20 by aasahr
[基金申请] FileCode能看出啥? +7 要乐观耀哥 2026-08-10 17/850 2026-08-11 10:50 by 要乐观耀哥
[基金申请] 基金中了 +15 laoda193707 2026-08-06 15/750 2026-08-11 00:11 by jiafei2190
[基金申请] 关于代码变化问题,想知道的进来 +17 且听虎啸 2026-08-07 24/1200 2026-08-10 18:35 by zhangduo2008
[基金申请] 静等基金结果 +5 gjjjzhong 2026-08-10 16/800 2026-08-10 17:19 by Tide man
[基金申请] 好奇怪的filecode +4 布布和一二 2026-08-08 5/250 2026-08-10 14:20 by 冰心玉壶晴
[基金申请] 据悉今年马上要出结果了 +7 瞬息宇宙 2026-08-10 8/400 2026-08-10 12:42 by Vivilian
[基金申请] 2026国自然放榜时间 +9 布布和一二 2026-08-08 9/450 2026-08-10 11:22 by xxxx2020
[基金申请] filecode与中标关系的预测 +5 布布和一二 2026-08-07 5/250 2026-08-09 16:15 by 袁向阳007
[基金申请] 关于filecode,很负责任的告诉大家 +6 爱看书的可乐 2026-08-08 7/350 2026-08-08 22:13 by a_niu
[基金申请] 关于豆爷回答的JTJC与%2F数量 +5 yang182083 2026-08-06 7/350 2026-08-08 18:29 by zhanghaozhu
[基金申请] 关于filecode +4 布布和一二 2026-08-07 7/350 2026-08-07 22:55 by zhanghaozhu
[基金申请] 大家散了吧,后缀研究没有意义,别浪费时间了,过好目前的每一天,不要焦虑 +5 Tide man 2026-08-06 7/350 2026-08-07 13:11 by 医学老男孩
[基金申请] filecode +14 等待解的谜 2026-08-06 19/950 2026-08-07 12:20 by wlwhappy
[基金申请] filecode +8 布布和一二 2026-08-06 11/550 2026-08-06 20:41 by tangpu318
[基金申请] 影响面上的因素 +8 布布和一二 2026-08-05 11/550 2026-08-06 10:41 by 宝贝虫子
信息提示
请填处理意见