24小时热门版块排行榜    

查看: 525  |  回复: 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 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 综述论文作为代表作会不会影响评审专家的印象分? +11 yufeiwaner 2026-08-09 12/600 2026-08-12 01:27 by 南京中西医
[基金申请] 2019年青年基金涵评意见,大家看看几个A,几个B? +4 Tide man 2026-08-11 4/200 2026-08-12 00:39 by liuqidi
[基金申请] 奇怪,两个人的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
[基金申请] 帮忙看看fileCode +7 wwncly 2026-08-10 13/650 2026-08-11 19:36 by 冰心玉壶晴
[硕博家园] 读博的好处 +3 lnee 2026-08-11 3/150 2026-08-11 18:10 by 希望我好好的
[论文投稿] 职称评审,求友友推荐见刊最快的期刊 +3 工厂打螺丝 2026-08-08 3/150 2026-08-11 13:42 by 会议编辑
[基金申请] FileCode能看出啥? +7 要乐观耀哥 2026-08-10 17/850 2026-08-11 10:50 by 要乐观耀哥
[基金申请] 我的国基提前知道中了,可是同事的操作让我实在接受不了,怎么会有这样的人 +8 家与远方 2026-08-10 13/650 2026-08-11 09:49 by 家与远方
[基金申请] 基金中了 +15 laoda193707 2026-08-06 15/750 2026-08-11 00:11 by jiafei2190
[基金申请] 关于Filecode分析方法 +3 majunge000 2026-08-10 3/150 2026-08-10 15:46 by lch2012
[基金申请] 国自然结果 +4 Vierhys 2026-08-10 8/400 2026-08-10 15:06 by Vierhys
[基金申请] 好奇怪的filecode +4 布布和一二 2026-08-08 5/250 2026-08-10 14:20 by 冰心玉壶晴
[基金申请] 关于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
[基金申请] 化学口download_prp&fileCode的固定段好像这几天一直没变,有变的大神么? +3 Tide man 2026-08-07 4/200 2026-08-07 22:39 by Tide man
[基金申请] 固定端突然变了,今天 +6 archvillain 2026-08-06 10/500 2026-08-07 16:03 by 医学老男孩
[基金申请] filecode +8 布布和一二 2026-08-06 11/550 2026-08-06 20:41 by tangpu318
[基金申请] 求各位大神看下 100+6 hpkpkpkp 2026-08-05 33/1650 2026-08-06 14:49 by zhiyanjiang
信息提示
请填处理意见