| 查看: 1325 | 回复: 7 | |||
| 当前主题已经存档。 | |||
phyfriday金虫 (小有名气)
|
[交流]
【求助】20金求助matlab中contour plot命令的源码
|
||
| 急切求教各位高手,如何获知matlab中等高线命令--contour的算法或源代码? |
» 猜你喜欢
三甲基碘化亚砜的氧化反应
已经有4人回复
请问下大家为什么这个铃木偶联几乎不反应呢
已经有5人回复
请问有评职称,把科研教学业绩算分排序的高校吗
已经有5人回复
孩子确诊有中度注意力缺陷
已经有12人回复
2025冷门绝学什么时候出结果
已经有3人回复
天津工业大学郑柳春团队欢迎化学化工、高分子化学或有机合成方向的博士生和硕士生加入
已经有4人回复
康复大学泰山学者周祺惠团队招收博士研究生
已经有6人回复
AI论文写作工具:是科研加速器还是学术作弊器?
已经有3人回复
论文投稿,期刊推荐
已经有4人回复
硕士和导师闹得不愉快
已经有13人回复

coldwind042
金虫 (正式写手)
- 应助: 0 (幼儿园)
- 贵宾: 0.03
- 金币: 543.5
- 红花: 3
- 帖子: 630
- 在线: 175.2小时
- 虫号: 154293
- 注册: 2006-01-03
- 性别: GG
- 专业: 水工结构和材料及施工
2楼2009-04-27 13:44:23
hitzhang
木虫 (正式写手)
- 仿真EPI: 1
- 应助: 0 (幼儿园)
- 贵宾: 2.15
- 金币: 1376.7
- 散金: 969
- 红花: 8
- 帖子: 862
- 在线: 226.4小时
- 虫号: 390575
- 注册: 2007-06-02
- 性别: GG
- 专业: 无机非金属类电介质与电解
★ ★ ★ ★ ★
sunxiao(金币+3,VIP+0):thank you 4-28 05:24
phyfriday(金币+2,VIP+0):谢谢 4-28 09:19
sunxiao(金币+3,VIP+0):thank you 4-28 05:24
phyfriday(金币+2,VIP+0):谢谢 4-28 09:19
|
function [cout, hand] = contour(varargin) %CONTOUR Contour plot. % CONTOUR(Z) is a contour plot of matrix Z treating the values in Z % as heights above a plane. A contour plot are the level curves % of Z for some values V. The values V are chosen automatically. % CONTOUR(X,Y,Z) X and Y specify the (x,y) coordinates of the % surface as for SURF. The X and Y data will be transposed or sorted % to bring it to MESHGRID form depending on the span of the first % row and column of X (to orient the data) and the order of the % first row of X and the first column of Y (to sorted the data). The % X and Y data must be consistently sorted in that if the first % element of a column of X is larger than the first element of % another column that all elements in the first column are larger % than the corresponding elements of the second. Similarly Y must be % consistently sorted along rows. % CONTOUR(Z,N) and CONTOUR(X,Y,Z,N) draw N contour lines, % overriding the automatic value. % CONTOUR(Z,V) and CONTOUR(X,Y,Z,V) draw LENGTH(V) contour lines % at the values specified in vector V. Use CONTOUR(Z,[v v]) or % CONTOUR(X,Y,Z,[v v]) to compute a single contour at the level v. % CONTOUR(AX,...) plots into AX instead of GCA. % [C,H] = CONTOUR(...) returns contour matrix C as described in % CONTOURC and a handle H to a contourgroup object. This handle can % be used as input to CLABEL. % % The contours are normally colored based on the current colormap % and are drawn as PATCH objects. You can override this behavior % with the syntax CONTOUR(...,LINESPEC) to draw the contours % with the color and linetype specified. See the help for PLOT % for more information about LINESPEC values. % % The above inputs to CONTOUR can be followed by property/value % pairs to specify additional properties of the contour object. % % Uses code by R. Pawlowicz to handle parametric surfaces and % inline contour labels. % % Example: % [c,h] = contour(peaks); clabel(c,h), colorbar % % See also CONTOUR3, CONTOURF, CLABEL, COLORBAR, MESHGRID. % Additional details: % % CONTOUR uses CONTOUR3 to do most of the contouring. Unless % a linestyle is specified, CONTOUR will draw PATCH objects % with edge color taken from the current colormap. When a linestyle % is specified, LINE objects are drawn. % % Thanks to R. Pawlowicz (IOS) rich@ios.bc.ca for 'contours.m' and % 'clabel.m/inline_labels' so that contour now works with parametric % surfaces and inline contour labels. % Copyright 1984-2007 The MathWorks, Inc. % $Revision: 5.18.4.18 $ $Date: 2007/11/13 00:10:21 $ [v6,args] = usev6plotapi(varargin{:},'-mfilename',mfilename); if v6 [c,h] = Lcontourv6(args{:}); else % Parse possible Axes input error(nargchk(1,inf,nargin,'struct')); [cax,args] = axescheck(args{:}); [pvpairs,args,msg] = parseargs(args); %#ok if ~isempty(msg), error(msg); end %#ok if isempty(cax) || isa(handle(cax),'hg.axes') cax = newplot(cax); parax = cax; hold_state = ishold(cax); else parax = cax; cax = ancestor(cax,'Axes'); hold_state = true; end h = specgraph.contourgroup('parent',parax,pvpairs{:}); set(h,'refreshmode','auto'); c = get(h,'contourmatrix'); if ~hold_state view(cax,2); set(cax,'box','on','layer','top'); grid(cax,'off') end plotdoneevent(cax,h); h = double(h); end if nargout > 0 cout = c; hand = h; end function [c,h] = Lcontourv6(varargin) % Parse possible Axes input error(nargchk(1,6,nargin,'struct')); [cax,args] = axescheck(varargin{:}); cax = newplot(cax); [c,h,msg] = contour3(cax,args{:}); if ~isempty(msg), error(msg); end %#ok set(h,'ZData',[]); if ~ishold(cax) view(cax,2); set(cax,'Box','on'); grid(cax,'off') end function [pvpairs,args,msg] = parseargs(args) msg = ''; % separate pv-pairs from opening arguments [args,pvpairs] = parseparams(args); % check for special string arguments trailing data arguments if ~isempty(pvpairs) [l,c,m,tmsg]=colstyle(pvpairs{1}); %#ok if isempty(tmsg) args = {args{:},pvpairs{1}}; pvpairs = pvpairs(2:end); end msg = checkpvpairs(pvpairs); end nargs = length(args); x = []; y = []; z = []; if ischar(args{end}) [l,c,m,tmsg] = colstyle(args{end}); %#ok if ~isempty(tmsg), msg = sprintf('Unknown option "%s".',args{end}); end if ~isempty(c) pvpairs = {'linecolor',c,pvpairs{:}}; end if ~isempty(l) pvpairs = {'linestyle',l,pvpairs{:}}; end nargs = nargs - 1; end if (nargs == 2) || (nargs == 4) if (nargs == 2) z = datachk(args{1}); pvpairs = {'zdata',z,pvpairs{:}}; else x = datachk(args{1}); y = datachk(args{2}); z = datachk(args{3}); pvpairs = {'xdata',x,'ydata',y,'zdata',z,pvpairs{:}}; end if (length(args{nargs}) == 1) && (fix(args{nargs}) == args{nargs}) % N zmin = min(real(double(z( )));zmax = max(real(double(z( )));if args{nargs} == 1 pvpairs = {'levellist',(zmin+zmax)/2, pvpairs{:}}; else levs = linspace(zmin,zmax,args{nargs}+2); pvpairs = {'levellist',levs(2:end-1),pvpairs{:}}; end else % levels pvpairs = {'levellist',unique(args{nargs}),pvpairs{:}}; end elseif (nargs == 1) z = datachk(args{1}); pvpairs = {'zdata',z,pvpairs{:}}; elseif (nargs == 3) x = datachk(args{1}); y = datachk(args{2}); z = datachk(args{3}); pvpairs = {'xdata',x,'ydata',y,'zdata',z,pvpairs{:}}; end % Make sure that the data is consistent if x and y are specified. if ~isempty(x) msg = xyzcheck(x,y,z); end if ~isempty(z) && isempty(msg) k = find(isfinite(z)); zmax = max(z(k)); zmin = min(z(k)); if ~any(k) warning('MATLAB:contour:NonFiniteData','Contour not rendered for non-finite ZData'); elseif isempty(z) || (zmax == zmin) warning('MATLAB:contour:ConstantData','Contour not rendered for constant ZData'); end end args = []; |
3楼2009-04-27 19:17:52
woshilsh
荣誉版主 (职业作家)
- 应助: 43 (小学生)
- 贵宾: 10.33
- 金币: 21115.1
- 散金: 737
- 红花: 22
- 帖子: 3777
- 在线: 639.7小时
- 虫号: 293038
- 注册: 2006-11-04
- 专业: 计算机应用技术
- 管辖: 仿真模拟

4楼2009-04-27 19:41:10
phyfriday
金虫 (小有名气)
- 应助: 0 (幼儿园)
- 金币: 1333.3
- 散金: 19
- 红花: 1
- 帖子: 298
- 在线: 110.7小时
- 虫号: 437424
- 注册: 2007-08-26
- 性别: GG
- 专业: 激光

5楼2009-04-28 09:18:34
dnp
荣誉版主 (知名作家)
小木虫浪子
- 应助: 74 (初中生)
- 贵宾: 18.476
- 金币: 18802.9
- 散金: 2040
- 红花: 77
- 沙发: 6
- 帖子: 7303
- 在线: 593.6小时
- 虫号: 437184
- 注册: 2007-08-26
- 性别: GG
- 专业: 生物信息学
- 管辖: 有机交流
★ ★
phyfriday(金币+1,VIP+0):谢谢 4-28 19:49
kuhailangyu(金币+1,VIP+0):欢迎区长同志莅临指导! 4-29 20:40
phyfriday(金币+1,VIP+0):谢谢 4-28 19:49
kuhailangyu(金币+1,VIP+0):欢迎区长同志莅临指导! 4-29 20:40
|
h = specgraph.contourgroup('parent',parax,pvpairs{:})这个命令是一个GUI函数语句,调用的是结构体specgraph.contourgroup的句柄,然后对这个句柄进行GUI操作,所以这个是一个命令,而不是一个函数,如果要调用的话,你必须明白parax, pvpairs这两个变量代表什么,需要对specgraph.contourgroup这结构体数据里面有什么东西有了解,所以,慢慢顺藤摸瓜吧~~ |

6楼2009-04-28 15:07:46
phyfriday
金虫 (小有名气)
- 应助: 0 (幼儿园)
- 金币: 1333.3
- 散金: 19
- 红花: 1
- 帖子: 298
- 在线: 110.7小时
- 虫号: 437424
- 注册: 2007-08-26
- 性别: GG
- 专业: 激光

7楼2009-04-28 19:52:25
8楼2009-04-28 21:22:10














回复此楼
)));