数学建模必备

[复制链接]
8592|179
手机看帖
扫描二维码
随时随地手机跟帖
gaoyang9992006|  楼主 | 2015-8-19 20:21 | 显示全部楼层 |阅读模式
这个资料太好了,都是源码,必须的回复看。
游客,如果您要查看本帖隐藏内容请回复

评论
cxjj123 2018-11-20 09:38 回复TA
是源程序,帮助很大 

相关帖子

gaoyang9992006|  楼主 | 2015-8-19 20:22 | 显示全部楼层
随便贴几个给大家看看。
%空间曲线图
% PLOT3(x,y,z,s)其中x,y,z为向量,每一组分量代表一个数据点。
%                    s为表示颜色、连线和标记选择的字符串
%例如 曲线x=exp(-0.2*z)*cos(0.5*pi*z),y=exp(-0.2*z)*sin(0.5*pi*z), 0<z<20。
%
%  clear;close;z=0:0.1:20;r=exp(-0.2*z);th=0.5*pi*z;
%  x=r.*cos(th);y=r.*sin(th);plot3(x,y,z,'r');
%
%PLOT3  Plot lines and points in 3-D space.
%   PLOT3() is a three-dimensional analogue of PLOT().
%
%   PLOT3(x,y,z), where x, y and z are three vectors of the same length,
%   plots a line in 3-space through the points whose coordinates are the
%   elements of x, y and z.
%
%   PLOT3(X,Y,Z), where X, Y and Z are three matrices of the same size,
%   plots several lines obtained from the columns of X, Y and Z.
%
%   Various line types, plot symbols and colors may be obtained with
%   PLOT3(X,Y,Z,s) where s is a 1, 2 or 3 character string made from
%   the characters listed under the PLOT command.
%
%   PLOT3(x1,y1,z1,s1,x2,y2,z2,s2,x3,y3,z3,s3,...) combines the plots
%   defined by the (x,y,z,s) fourtuples, where the x's, y's and z's are
%   vectors or matrices and the s's are strings.
%
%   Example: A helix:
%
%       t = 0:pi/50:10*pi;
%       plot3(sin(t),cos(t),t);
%
%   PLOT3 returns a column vector of handles to LINE objects, one
%   handle per line. The X,Y,Z triples, or X,Y,Z,S quads, can be
%   followed by parameter/value pairs to specify additional
%   properties of the lines.
%
%   See also PLOT, LINE, AXIS, VIEW, MESH, SURF.

%-------------------------------
%   Additional details:
%
%
%   If the NextPlot axis property is REPLACE (HOLD is off), PLOT3 resets
%   all axis properties, except Position, to their default values, and
%   deletes all axis children (line, patch, text, surface, and
%   image objects).

%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 5.3 $  $Date: 1997/11/21 23:34:01 $
%   Built-in function.


使用特权

评论回复
gaoyang9992006|  楼主 | 2015-8-19 20:22 | 显示全部楼层
%二维图(一元函数图)
%用法 plot(x,y,s) 其中x,y为向量,每一对分量代表一个数据点。
%                    s为表示颜色、连线和标记选择的字符串
%图形的线型,标记,颜色均可设定,常用有
%       颜色           |                线型                        标记
% ---------------------      -------------------  -------------------
%   b          蓝(默认)               -      实线(默认)        无(默认)
%   g           绿             --     虚线         *          星
%   r           红             :      粗点线       .          点
%   y           黄             -.     点划线       o          圈
%   m           洋红                               x          叉
%   c           青                                 +          十字
%   w           白                                 s          方块
%   k           黑                                 d          菱形
%                                                  v          下三角形
%                                                  ^          上三角形
%                                                  <          左三角形
%                                                  >          右三角形
%                                                  h          六角形
%                                                  p          五角形
%例如
%    x=0:0.2:2*pi;y=sin(x);
%    plot(x,y,'r*')
%
%PLOT   Linear plot.
%   PLOT(X,Y) plots vector Y versus vector X. If X or Y is a matrix,
%   then the vector is plotted versus the rows or columns of the matrix,
%   whichever line up.
%
%   PLOT(Y) plots the columns of Y versus their index.
%   If Y is complex, PLOT(Y) is equivalent to PLOT(real(Y),imag(Y)).
%   In all other uses of PLOT, the imaginary part is ignored.
%
%   Various line types, plot symbols and colors may be obtained with
%   PLOT(X,Y,S) where S is a character string made from one element
%   from any or all the following 3 colunms:
%
%          y     yellow        .     point              -     solid
%          m     magenta       o     circle             :     dotted
%          c     cyan          x     x-mark             -.    dashdot
%          r     red           +     plus               --    dashed   
%          g     green         *     star
%          b     blue          s     square
%          w     white         d     diamond
%          k     black         v     triangle (down)
%                              ^     triangle (up)
%                              <     triangle (left)
%                              >     triangle (right)
%                              p     pentagram
%                              h     hexagram
%                        
%   For example, PLOT(X,Y,'c+:') plots a cyan dotted line with a plus
%   at each data point; PLOT(X,Y,'bd') plots blue diamond at each data
%   point but does not draw any line.
%
%   PLOT(X1,Y1,S1,X2,Y2,S2,X3,Y3,S3,...) combines the plots defined by
%   the (X,Y,S) triples, where the X's and Y's are vectors or matrices
%   and the S's are strings.  
%
%   For example, PLOT(X,Y,'y-',X,Y,'go') plots the data twice, with a
%   solid yellow line interpolating green circles at the data points.
%
%   The PLOT command, if no color is specified, makes automatic use of
%   the colors specified by the axes ColorOrder property.  The default
%   ColorOrder is listed in the table above for color systems where the
%   default is yellow for one line, and for multiple lines, to cycle
%   through the first six colors in the table.  For monochrome systems,
%   PLOT cycles over the axes LineStyleOrder property.
%
%   PLOT returns a column vector of handles to LINE objects, one
%   handle per line.
%
%   The X,Y pairs, or X,Y,S triples, can be followed by
%   parameter/value pairs to specify additional properties
%   of the lines.
%                                   
%   See also SEMILOGX, SEMILOGY, LOGLOG, GRID, CLF, CLC, TITLE,
%   XLABEL, YLABEL, AXIS, AXES, HOLD, COLORDEF, and SUBPLOT.

%   If the NextPlot axes property is "replace" (HOLD is off), PLOT resets
%   all axes properties, except Position, to their default values,
%   deletes all axes children (line, patch, text, surface, and
%   image objects), and sets the View property to [0 90].

%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 5.7 $  $Date: 1997/11/21 23:33:07 $
%   Built-in function.


使用特权

评论回复
gaoyang9992006|  楼主 | 2015-8-19 20:23 | 显示全部楼层
function h = mesh(x,y,z,c)
%空间曲面图
%  mesh(x,y,z)其中x,y,z为同阶矩阵,每一组对应元素代表一个网格点。
%
%例如 曲面 z=x.*exp(-x^2-y^2),-2<x<2,-2<y<2。
%
%     clear;close;xa=-2:.2:2;ya=xa;
%     [x,y]=meshgrid(xa,ya);z=x.*exp(-x.^2-y.^2);
%     mesh(x,y,z);%网格图
%
%MESH   3-D mesh surface.
%   MESH(X,Y,Z,C) plots the colored parametric mesh defined by
%   four matrix arguments.  The view point is specified by VIEW.
%   The axis labels are determined by the range of X, Y and Z,
%   or by the current setting of AXIS.  The color scaling is determined
%   by the range of C, or by the current setting of CAXIS.  The scaled
%   color values are used as indices into the current COLORMAP.
%
%   MESH(X,Y,Z) uses C = Z, so color is proportional to mesh height.
%
%   MESH(x,y,Z) and MESH(x,y,Z,C), with two vector arguments replacing
%   the first two matrix arguments, must have length(x) = n and
%   length(y) = m where [m,n] = size(Z).  In this case, the vertices
%   of the mesh lines are the triples (x(j), y(i), Z(i,j)).
%   Note that x corresponds to the columns of Z and y corresponds to
%   the rows.
%
%   MESH(Z) and MESH(Z,C) use x = 1:n and y = 1:m.  In this case,
%   the height, Z, is a single-valued function, defined over a
%   geometrically rectangular grid.
%
%   MESH returns a handle to a SURFACE object.
%
%   AXIS, CAXIS, COLORMAP, HOLD, SHADING and VIEW set figure, axes, and
%   surface properties which affect the display of the mesh.
%
%   See also SURF, MESHC, MESHZ, WATERFALL.

%-------------------------------
%   Additional details:
%
%   MESH sets the FaceColor property to background color and the EdgeColor
%   property to 'flat'.
%
%   If the NextPlot axis property is REPLACE (HOLD is off), MESH resets
%   all axis properties, except Position, to their default values
%   and deletes all axis children (line, patch, surf, image, and
%   text objects).

%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 5.7 $  $Date: 1997/11/21 23:33:57 $

%   J.N. Little 1-5-92
%   Modified 2-3-92, LS.

user_view = 0;
cax = newplot;
fc = get(gca,'color');
if strcmp(lower(fc),'none')
    fc = get(gcf,'color');
end

if nargin == 1
    hh = surface(x,'FaceColor',fc,'EdgeColor','flat', 'FaceLighting', 'none', 'EdgeLighting', 'flat');
elseif nargin == 2
        if isstr(y), error('Invalid argument.'); end
    [my ny] = size(y);
    [mx nx] = size(x);
    if mx == my & nx == ny
        hh = surface(x,y,'FaceColor',fc,'EdgeColor','flat', 'FaceLighting', 'none', 'EdgeLighting', 'flat');
    else
        if my*ny == 2 % must be [az el]
            hh = surface(x,'FaceColor',fc,'EdgeColor','flat', 'FaceLighting', 'none', 'EdgeLighting', 'flat');
            set(gca,'View',y);
            user_view = 1;
        else
            error('Invalid input arguments.');
        end
    end
elseif nargin == 3
        if isstr(y) | isstr(z), error('Invalid argument.'); end
    if min(size(y)) == 1 & min(size(z)) == 1 % old style
        hh = surface(x,'FaceColor',fc,'EdgeColor','flat', 'FaceLighting', 'none', 'EdgeLighting', 'flat');
        set(gca,'View',y);
        user_view = 1;
    else
        hh = surface(x,y,z,'FaceColor',fc,'EdgeColor','flat', 'FaceLighting', 'none', 'EdgeLighting', 'flat');
    end
elseif nargin == 4
    hh = surface(x,y,z,c,'FaceColor',fc,'EdgeColor','flat', 'FaceLighting', 'none', 'EdgeLighting', 'flat');
else
    error('Requires 1, 2, 3, or 4 input arguments.');
end
if ~ishold & ~user_view
    view(3); grid on
end
if nargout == 1
    h = hh;
end


使用特权

评论回复
lvyunhua| | 2015-8-21 15:02 | 显示全部楼层
好东西,收下了。

使用特权

评论回复
limiao123| | 2015-9-8 17:11 | 显示全部楼层
论文中均需要模型分析

使用特权

评论回复
李元1992| | 2015-9-8 20:31 | 显示全部楼层
好好好激动

使用特权

评论回复
chenmo51| | 2015-9-12 17:50 | 显示全部楼层
谢谢!

使用特权

评论回复
西科小凡| | 2015-9-22 11:35 | 显示全部楼层
看看。。

使用特权

评论回复
快乐人生929| | 2015-10-5 16:16 | 显示全部楼层
学习学习

使用特权

评论回复
sibaidong| | 2015-10-23 17:25 | 显示全部楼层
好!

使用特权

评论回复
jjl3| | 2015-10-23 17:38 | 显示全部楼层
学习学习

使用特权

评论回复
Eric封| | 2015-11-16 22:01 | 显示全部楼层
学习

使用特权

评论回复
gaoyang9992006|  楼主 | 2015-11-17 17:18 | 显示全部楼层
就不一一回复了,感谢各位支持。

使用特权

评论回复
wei12321cjlk| | 2015-11-19 10:35 | 显示全部楼层
好东西

使用特权

评论回复
shenliwuji| | 2015-12-10 12:46 | 显示全部楼层
看看啊

使用特权

评论回复
1234567li| | 2015-12-19 17:31 | 显示全部楼层
谢LZ

使用特权

评论回复
Vantica| | 2015-12-21 12:42 | 显示全部楼层
算法加源码简直就是我的最爱啊,多谢

使用特权

评论回复
dongshan| | 2016-1-28 13:06 | 显示全部楼层
什么东西,回复地看一下。

使用特权

评论回复
1R1X| | 2016-3-2 15:22 | 显示全部楼层
想好好学一下MATLAB!!!!

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

认证:西安公路研究院南京院
简介:主要工作从事监控网络与通信网络设计,以及从事基于嵌入式的通信与控制设备研发。擅长单片机嵌入式系统物联网设备开发,音频功放电路开发。

1889

主题

15608

帖子

197

粉丝