24小时热门版块排行榜    

查看: 785  |  回复: 6
当前主题已经存档。

Rings

银虫 (小有名气)

[交流] 【求助】函数图像绘制【已完成】

请教各个 怎么会出如下函数的图像,函数如附件:

[ Last edited by nono2009 on 2009-9-23 at 22:21 ]
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

mininurse

金虫 (正式写手)

★ ★
小木虫(金币+0.5):给个红包,谢谢回帖交流
kuhailangyu(金币+1,VIP+0):谢谢参与 6-30 16:06
给定x一系列的值,y一些列的值,计算出z,然后用surf来画吧
2楼2009-06-30 09:38:16
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

Rings

银虫 (小有名气)

Your answer is so sample....
3楼2009-06-30 10:07:43
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

hitzhang

木虫 (正式写手)

★ ★ ★ ★
小木虫(金币+0.5):给个红包,谢谢回帖交流
sunxiao(金币+3,VIP+0):很好很强大,谢谢zhang专家 7-1 23:12
引用回帖:
Originally posted by Rings at 2009-6-29 21:32:
请教各个 怎么会出如下函数的图像,函数如附件:

>> f='-z^2+3*x^2+y^2-8*x*y-6';
>> ezimplot3(f,[-20 20 -20 20 -20 20])
4楼2009-06-30 12:35:25
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

hitzhang

木虫 (正式写手)

★ ★ ★
kuhailangyu(金币+3,VIP+0):很好,很强大,很是感谢! 6-30 16:07
function h = ezimplot3(fun,domain,n,color)
% EZIMPLOT3    Easy to use 3D implicit plotter.
%   EZIMPLOT3(FUN) plots the inline function FUN(X,Y,Z) = 0 over the
%   default domain -2*PI < X < 2*PI, -2*PI < Y < 2*PI, -2*PI < Z < 2*PI.
%
%   EZIMPLOT3(FUN,DOMAIN)plots FUN over the specified DOMAIN instead of the
%   default domain. DOMAIN can be the vector [XMIN,XMAX,YMIN,YMAX,ZMIN,ZMAX]
%   or the vector [A,B] (to plot over A < X < B, A < Y < B, A < Z < B).
%
%   EZIMPLOT3(...,N) plots FUN over the default domain using an N-by-N grid.
%   The default value for N is 60.
%
% Example
% Plot x^3+exp(y)-cosh(z)=4
%
% via a string: f='x^3+exp(y)-cosh(z)-4'
% ezimplot3(f)
%
% via a vectorized function handle: f = @(x,y,z) x.^3+exp(y)-cosh(z)-4
% ezimplot3(f)
%
% Note: this function do not use the ezgraph3 standard, like ezsurf, ezmesh
% ,etc, does. Because of that, ezimplot3 only tries to imitate that
% interface. A future work must be to modify the ezgraph3 to include a
% routine for implicit surfaces based on this file
%
%   Inspired by works of:   A.Jutan     UWO 02-02-98 ajutan@julian.uwo.ca
%   Made by:                G.Morales   UC  03-20-09 gmorales@uc.edu.ve
%
if nargin == 1
    domain = [-2*pi, 2*pi];             % default domain: -2*pi < xi < 2*pi
    n = 60;                             % default grid size
elseif nargin == 2
    n = 60;                             % just default grid
end
if  size(domain,2) == 2
    domain = repmat(domain,1,3);        %domain repeated in all variables
end
xm = linspace(domain(1), domain(2), n); % generating the volume data
ym = linspace(domain(3), domain(4), n);
zm = linspace(domain(5), domain(6), n);
[x,y,z] = meshgrid(xm, ym, zm);

if ischar(fun)
    fun = inline(vectorize(fun)); % making sure string "fun" is vectorized
    fvalues = feval(fun,x,y,z);         % evaluating "fun" in domain
elseif isa(fun,'function_handle')
    fvalues = fun(x,y,z);               % evaluating "fun" in domain
    fun = char(fun); fun = fun(9:end);  % pre-formatting of graph title
end
h = patch(isosurface(x,y,z, fvalues, 0)); %"patch" handles the structure
                                          %sent by "isosurface"
isonormals(x,y,z,fvalues,h) %Recalculating the isosurface normals based on
                            %the volume data
set(h,'FaceColor','red','EdgeColor','none');
xlabel('x');ylabel('y');zlabel('z');% naming the axis
alpha(0.8) % adjusting for some transparency
grid on
view(3)
axis equal
camlight
lighting gouraud
title([strrep(char(fun),'.','') ' = 0']); % graph title without "."
5楼2009-06-30 12:36:02
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

mininurse

金虫 (正式写手)


小木虫(金币+0.5):给个红包,谢谢回帖交流
楼上老兄太强了,不服不行
6楼2009-06-30 14:29:21
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

Rings

银虫 (小有名气)

谢谢,楼上的兄弟
7楼2009-07-01 09:50:06
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 Rings 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[论文投稿] 售SCI一区T0P文章,我:8O.55.1.O.54,科目全,可伽急 +3 k0dTPqJtl0jt 2026-08-14 5/250 2026-08-15 18:22 by 7huP8NPKZCp9
[博后之家] 售SCI一区T0P文章,我:8O.55.1.O.5.4,科目齐全,可+急 +3 k0dTPqJtl0jt 2026-08-14 3/150 2026-08-15 18:10 by 7huP8NPKZCp9
[基金申请] filecode=后面第一个是大写字母 +3 wangze12014 2026-08-14 4/200 2026-08-15 18:05 by babangida
[考博] 售SCI一区T0P文章,我:8.O.55.1.O.54,科目齐全,可+急 +3 7lpolszZVXgi 2026-08-14 7/350 2026-08-15 17:58 by 7huP8NPKZCp9
[基金申请] 时间戳又变了8-15 +11 archvillain 2026-08-15 20/1000 2026-08-15 17:47 by 医学老男孩
[考研] 售SCI文章,我:8O5.5.1.O.54,科目齐全,可+急 +5 7lpolszZVXgi 2026-08-14 9/450 2026-08-15 17:46 by 7huP8NPKZCp9
[博后之家] 售SCI一区T0P文章,我:8O.55.1.O.54,科目全,可伽急 +3 HFw0lei2R37i 2026-08-14 5/250 2026-08-15 17:42 by 7huP8NPKZCp9
[基金申请] 小木虫上这么多卖论文的,真有人买论文么?感觉没必要啊 +12 Tide man 2026-08-10 13/650 2026-08-15 16:34 by 氺木
[基金申请] 欢迎发来filecode的Mz6后的代码验证其规律 +27 医学老男孩 2026-08-13 58/2900 2026-08-15 15:57 by GZUZM
[考研] 售SCI一区T0P文章,我:8.O55.1.O.54,科目全,可十急 +4 HFw0lei2R37i 2026-08-14 8/400 2026-08-15 14:41 by QXtWNz7PI7wZ
[考博] 售一区SCI文章T0P,我:8O.551.O54,科目全,可十急 +3 k0dTPqJtl0jt 2026-08-14 3/150 2026-08-15 12:33 by KxMI1BYBxWX1
[硕博家园] 售SCI一区T0P文章,我:8.O55.1.O.54,科目全,可十急 +3 HFw0lei2R37i 2026-08-14 4/200 2026-08-15 04:17 by 4wMiSEwB6436
[基金申请] 咱们一起用铁证分析2026国家社科基金中标与否 +7 启萌科技 2026-08-12 22/1100 2026-08-14 23:45 by Noways
[教师之家] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +3 HFw0lei2R37i 2026-08-14 5/250 2026-08-14 22:32 by 4wMiSEwB6436
[基金申请] FileCode能看出啥? +10 要乐观耀哥 2026-08-10 32/1600 2026-08-14 09:37 by 要乐观耀哥
[基金申请] Filecode 又变了,巨变 +3 WH3796 2026-08-12 4/200 2026-08-13 14:13 by 小木虫6752397
[基金申请] 2019年青年基金涵评意见,大家看看几个A,几个B? +11 Tide man 2026-08-11 11/550 2026-08-13 07:35 by 撸猫猫
[基金申请] 帮忙看看fileCode +7 wwncly 2026-08-10 13/650 2026-08-11 19:36 by 冰心玉壶晴
[基金申请] 为什么网上很多人说本周 12号出结果 +6 瞬息宇宙 2026-08-10 7/350 2026-08-11 19:25 by Tide man
[基金申请] 面上项目filecode邪修 +5 西山十月 2026-08-09 7/350 2026-08-10 07:32 by 仁砚薪传
信息提示
请填处理意见