Main Content

Fmesh

阴谋3-D mesh

Description

例子

Fmesh(<一种HreF="//www.tianjin-qmedu.com/au/help/symbolic/#bu008tv-f" class="intrnllnk">Fcreates a mesh plot of the symbolic expressionF(x,y)默认间隔[-5 5]为了X一种ndy

Fmesh(<一种HreF="//www.tianjin-qmedu.com/au/help/symbolic/#bu008tv-f" class="intrnllnk">F,,,,<一种HreF="//www.tianjin-qmedu.com/au/help/symbolic/#bu008tv-minmax" class="intrnllnk">[min max]plotsF(x,y)超过tHe一世nterv一种l[min max]为了X一种ndy

例子

Fmesh(<一种HreF="//www.tianjin-qmedu.com/au/help/symbolic/#bu008tv-f" class="intrnllnk">F,,,,<一种HreF="//www.tianjin-qmedu.com/au/help/symbolic/#bu008tv-xminxmaxyminymax" class="intrnllnk">[xmin xmax ymin ymax]plotsF(x,y)超过tHe一世nterv一种l[Xmin Xmax]为了X一种nd[ymin ymax]为了yFmeshF你nction usesSymvarto order the variables and assign intervals.

例子

Fmesh(<一种HreF="//www.tianjin-qmedu.com/au/help/symbolic/#bu008tv-funxfunyfunz" class="intrnllnk">Funx,Funy,Funz绘制参数网格X=X((你,,,,v),,,,y=y((你,,,,v),,,,z=z((你,,,,v)超过tHe一世nterv一种l[-5 5]为了一种ndv

Fmesh(<一种HreF="//www.tianjin-qmedu.com/au/help/symbolic/#bu008tv-funxfunyfunz" class="intrnllnk">Funx,Funy,Funz,,,,<一种HreF="//www.tianjin-qmedu.com/au/help/symbolic/#bu008tv-uvminuvmax" class="intrnllnk">[uvmin uvmax]绘制参数网格X=X((你,,,,v),,,,y=y((你,,,,v),,,,z=z((你,,,,v)超过tHe一世nterv一种l[uvmin uvmax]为了一种ndv

Fmesh(<一种HreF="//www.tianjin-qmedu.com/au/help/symbolic/#bu008tv-funxfunyfunz" class="intrnllnk">Funx,Funy,Funz,,,,<一种HreF="//www.tianjin-qmedu.com/au/help/symbolic/#bu008tv-uminumaxvminvmax" class="intrnllnk">[UMIN UMAX VMIN VMAX]绘制参数网格X=X((你,,,,v),,,,y=y((你,,,,v),,,,z=z((你,,,,v)超过tHe一世nterv一种l[Umin Umax]为了一种nd[vmin vmax]为了vFmeshF你nction usesSymvarto order the parametric variables and assign intervals.

Fmesh(___,,,,<一种HreF="//www.tianjin-qmedu.com/au/help/symbolic/#bu008tv_sep_mw_3a76f056-2882-44d7-8e73-c695c0c54ca8" class="intrnllnk">LineSpec你sestHeLineSpec设置行样式,标记符号和情节颜色。

Fmesh(___,,,,<一种HreF="#namevaluepairarguments" class="intrnllnk">名称,价值使用一个或多个指定表面特性名称,价值配对参数。将此选项与上一个语法中的任何输入参数组合一起使用。

Fmesh(<一种HreF="//www.tianjin-qmedu.com/au/help/symbolic/#bu008tv-ax" class="intrnllnk">斧头,,,,___plots into the axes with the object斧头而不是当前轴对象gca

OBJ=Fmesh(___ret你rns一种F你nction surface object or a parameterized function surface object. Use the object to query and modify properties of a specific mesh.

Examples

Additional Examples: SeefsurfPage

笔记

For additional examples, follow the<一种HreF="//www.tianjin-qmedu.com/au/help/symbolic/fsurf.html">fsurfpage becauseFmesh一种ndfsurf共享相同的语法。所有示例fsurf页面申请Fmesh

3-D Mesh Plot of Symbolic Expression

阴谋一种mesh of the input (( X + cos (( y 超过tHedefault range - 5 < X < 5 一种nd - 5 < y < 5

symsXyfmesh(sin(x)+cos(y))

图包含一个轴对象。这斧头esOBJect contains an object of type functionsurface.

3-D Mesh Plot of Symbolic Function

绘制一个实际部分的3-D网格 t 一种 n - 1 (( X + 一世 y 超过tHedefault range - 5 < X < 5 一种nd - 5 < y < 5

symsF(x,y)F(x,y)=re一种l(atan(x + i*y)); fmesh(f)

图包含一个轴对象。这斧头esOBJect contains an object of type functionsurface.

Specify Plotting Interval of Mesh Plot

阴谋 (( X + cos (( y 超过 - π < X < π 一种nd - 5 < y < 5 通过将绘图间隔指定为第二个参数Fmesh

symsXyF=罪((X)+cos((y); fmesh(f, [-pi pi -5 5])

图包含一个轴对象。这斧头esOBJect contains an object of type functionsurface.

参数化网格图

阴谋tHeparameterized mesh

X = r cos (( s (( t y = r (( s (( t z = r cos (( t w H e r e r = 8 + (( 7 s + 5 t

为了 0 < s < 2 π 一种nd 0 < t < π 。Make the aspect ratio of the axes equal using斧头一世sequal。See the entire mesh by making the mesh partially transparent usingα

symsstr=8+罪((7*s + 5*t); x = r*cos(s)*sin(t); y = r*sin(s)*sin(t); z = r*cos(t); fmesh(x, y, z, [0 2*pi 0 pi],'行宽',,,,2)斧头一世sequalα((0。8)

图包含一个轴对象。轴对象包含一个类型的参数化functionsUrface的对象。

Additional Examples: SeefsurfPage

笔记

For additional examples, follow the<一种HreF="//www.tianjin-qmedu.com/au/help/symbolic/fsurf.html">fsurfpage becauseFmesh一种ndfsurf共享相同的语法。所有示例fsurf页面申请Fmesh

输入参数

全部收缩

Expression or function to be plotted, specified as a symbolic expression or function.

x-和y轴的绘图间隔,指定为两个数字的向量。默认值为[-5 5]

阴谋t一世ng interval for x- and y-axes, specified as a vector of four numbers. The default is[-5 5 -5 5]

Parametric functions of一种ndv,指定为符号表达式或函数。

阴谋t一世ng interval for一种ndv斧头es,,,,specified as a vector of two numbers. The default is[-5 5]

阴谋t一世ng interval for一种ndv,,,,specified as a vector of four numbers. The default is[-5 5 -5 5]

轴对象。If you do not specify an axes object, thenFmesh你sestHecurrent axes.

Line style, marker, and color, specified as a character vector or string containing symbols. The symbols can appear in any order. You do not need to specify all three characteristics (line style, marker, and color). For example, if you omit the line style and specify the marker, then the plot shows only the marker and no line.

Example:' - 或者'一世s一种red dashed line with circle markers

线样式 Description Resulting Line
' - ' Solid line

Sample of solid line

' - ' 虚线

Sample of dashed line

”:' 虚线

虚线样品

' - 。' 破折号线

Sample of dash-dotted line, with alternating dashes and dots

标记 Description Resulting Marker
”o' 圆圈

Sample of circle marker

”+” Plus sign

Sample of plus sign marker

”*' 星号

Sample of asterisk marker

'。' Point

Sample of point marker

'X' Cross

Sample of cross marker

”_' Horizontal line

Sample of horizontal line marker

”|” Vertical line

Sample of vertical line marker

' 正方形

Sample of square marker

”d' 钻石

钻石线标记的样本

”^' Upward-pointing triangle

Sample of upward-pointing triangle marker

'v' Downward-pointing triangle

Sample of downward-pointing triangle marker

”>' 右点三角形

右点三角形标记的样本

”<” Left-pointing triangle

Sample of left-pointing triangle marker

'P' Pentagram

Sample of pentagram marker

”H” hexagram

六边形标记样品

颜色名称 Short Name RGB三胞胎 外貌
'红色的' 'r' [1 0 0]

Sample of the color red

'绿色' ”g' [0 1 0]

Sample of the color green

”blue' ”b' [0 0 1]

蓝色样品

”cyan' ”c' [0 1 1]

Sample of the color cyan

”magenta' ”m' [1 0 1]

颜色洋红色样品

”yellow' 'y' [1 1 0]

Sample of the color yellow

”black' ”k' [0 0 0]

Sample of the color black

'白色的' 'W' [1 1 1]

颜色样品白色

名称值参数

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN,,,,wHereName是参数名称和Value一世stHecorresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and encloseName一世nquotes.

Example:“标记”,“ O”,“ MarkerfaceColor”,“红色”

每个方向评估点的数量,指定为数字。默认值为35。BecauseFmesh对象使用自适应评估,评估点的实际数量更大。

Example:100

在图下显示轮廓图,指定为'在'or”off',,,,or as numeric or logical1((tr你e) 或者0((错误的)。一个值'在'等同于tr你e,,,,一种nd”off'等同于错误的。因此,您可以将此属性的值用作逻辑值。该值存储为类型的ON/OFF逻辑值<一种HreF="https://au.mathworks.com/help/matlab/ref/matlab.lang.onoffswitchstate-class.html">matlab.lang.OnOffSwitchState

线色,指定为的插值函数,,,,一种nRGB triplet, a hexadecimal color code, a color name, or a short name. The default value of的插值函数colors the edges based on theZDataproperty values.

对于自定义颜色,请指定RGB三重态或十六进制颜色代码。

  • RGB三重态是一个三元素行矢量,其元素指定了颜色的红色,绿色和蓝色组件的强度。强度必须在范围内[0,1]; for example,[0.4 0.6 0.7]

  • A hexadecimal color code is a character vector or a string scalar that starts with a hash symbol ()Followed by three or six hexadecimal digits, which can range from0toF。这v一种lues are not case sensitive. Thus, the color codes”#FF8800”,,,,'#ff8800',,,,”#F80”,,,,一种nd'#f80'是等效的。

另外,您可以按名称指定一些常见的颜色。该表列出了命名的颜色选项,等效的RGB三重态和十六进制颜色代码。

颜色名称 Short Name RGB三胞胎 十六进制的颜色代码 外貌
'红色的' 'r' [1 0 0] '#ff0000'

Sample of the color red

'绿色' ”g' [0 1 0] '#00ff00'

Sample of the color green

”blue' ”b' [0 0 1] '#0000FF'

蓝色样品

”cyan' ”c' [0 1 1] ”#00FFFF”

Sample of the color cyan

”magenta' ”m' [1 0 1] ”#FF00FF”

颜色洋红色样品

”yellow' 'y' [1 1 0] '#ffff00'

Sample of the color yellow

”black' ”k' [0 0 0] ”#000000”

Sample of the color black

'白色的' 'W' [1 1 1] '#ffffff'

颜色样品白色

'没有任何' 不适用 不适用 不适用 No color

Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB®你ses一世nmany types of plots.

RGB三胞胎 十六进制的颜色代码 外貌
[0 0.4470 0.7410] ”#0072BD'

Sample of RGB triplet [0 0.4470 0.7410], which appears as dark blue

[0.8500 0.3250 0.0980] '#D95319'

Sample of RGB triplet [0.8500 0.3250 0.0980], which appears as dark orange

[0.9290 0.6940 0.1250] '#EDB120'

Sample of RGB triplet [0.9290 0.6940 0.1250], which appears as dark yellow

[0.4940 0.1840 0.5560] '#7E2F8E'

RGB三重态样品[0.4940 0.1840 0.5560]

[0.4660 0.6740 0.1880] ”#77AC30'

RGB三重态样品[0.4660 0.6740 0.1880],该样本如中等绿色

[0.3010 0.7450 0.9330] ”#4DBEEE'

Sample of RGB triplet [0.3010 0.7450 0.9330], which appears as light blue

[0.6350 0.0780 0.1840] '#a2142f'

Sample of RGB triplet [0.6350 0.0780 0.1840], which appears as dark red

Example:”blue'

Example:[0 0 1]

Example:'#0000FF'

线样式,指定为此表中列出的选项之一。

线样式 Description Resulting Line
' - ' Solid line

Sample of solid line

' - ' 虚线

Sample of dashed line

”:' 虚线

虚线样品

' - 。' 破折号线

Sample of dash-dotted line, with alternating dashes and dots

'没有任何' No line No line

Line width, specified as a positive value in points, where 1 point = 1/72 of an inch. If the line has markers, then the line width also affects the marker edges.

这line width cannot be thinner than the width of a pixel. If you set the line width to a value that is less than the width of a pixel on your system, the line displays as one pixel wide.

标记符号,,,,specified as one of the values listed in this table. By default, the object does not display markers. Specifying a marker symbol adds markers at each data point or vertex.

标记 Description Resulting Marker
”o' 圆圈

Sample of circle marker

”+” Plus sign

Sample of plus sign marker

”*' 星号

Sample of asterisk marker

'。' Point

Sample of point marker

'X' Cross

Sample of cross marker

”_' Horizontal line

Sample of horizontal line marker

”|” Vertical line

Sample of vertical line marker

' 正方形

Sample of square marker

”d' 钻石

钻石线标记的样本

”^' Upward-pointing triangle

Sample of upward-pointing triangle marker

'v' Downward-pointing triangle

Sample of downward-pointing triangle marker

”>' 右点三角形

右点三角形标记的样本

”<” Left-pointing triangle

Sample of left-pointing triangle marker

'P' Pentagram

Sample of pentagram marker

”H” hexagram

六边形标记样品

'没有任何' No markers 不适用

标记outline color, specified as'汽车',,,,一种nRGB triplet, a hexadecimal color code, a color name, or a short name. The default value of'汽车'使用与<一种HreF="//www.tianjin-qmedu.com/au/help/symbolic/#bu008tv_sep_shared-EdgeColor" class="intrnllnk">EdgeColor财产。

对于自定义颜色,请指定RGB三重态或十六进制颜色代码。

  • RGB三重态是一个三元素行矢量,其元素指定了颜色的红色,绿色和蓝色组件的强度。强度必须在范围内[0,1]; for example,[0.4 0.6 0.7]

  • A hexadecimal color code is a character vector or a string scalar that starts with a hash symbol ()Followed by three or six hexadecimal digits, which can range from0toF。这v一种lues are not case sensitive. Thus, the color codes”#FF8800”,,,,'#ff8800',,,,”#F80”,,,,一种nd'#f80'是等效的。

另外,您可以按名称指定一些常见的颜色。该表列出了命名的颜色选项,等效的RGB三重态和十六进制颜色代码。

颜色名称 Short Name RGB三胞胎 十六进制的颜色代码 外貌
'红色的' 'r' [1 0 0] '#ff0000'

Sample of the color red

'绿色' ”g' [0 1 0] '#00ff00'

Sample of the color green

”blue' ”b' [0 0 1] '#0000FF'

蓝色样品

”cyan' ”c' [0 1 1] ”#00FFFF”

Sample of the color cyan

”magenta' ”m' [1 0 1] ”#FF00FF”

颜色洋红色样品

”yellow' 'y' [1 1 0] '#ffff00'

Sample of the color yellow

”black' ”k' [0 0 0] ”#000000”

Sample of the color black

'白色的' 'W' [1 1 1] '#ffffff'

颜色样品白色

'没有任何' 不适用 不适用 不适用 No color

Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB uses in many types of plots.

RGB三胞胎 十六进制的颜色代码 外貌
[0 0.4470 0.7410] ”#0072BD'

Sample of RGB triplet [0 0.4470 0.7410], which appears as dark blue

[0.8500 0.3250 0.0980] '#D95319'

Sample of RGB triplet [0.8500 0.3250 0.0980], which appears as dark orange

[0.9290 0.6940 0.1250] '#EDB120'

Sample of RGB triplet [0.9290 0.6940 0.1250], which appears as dark yellow

[0.4940 0.1840 0.5560] '#7E2F8E'

RGB三重态样品[0.4940 0.1840 0.5560]

[0.4660 0.6740 0.1880] ”#77AC30'

RGB三重态样品[0.4660 0.6740 0.1880],该样本如中等绿色

[0.3010 0.7450 0.9330] ”#4DBEEE'

Sample of RGB triplet [0.3010 0.7450 0.9330], which appears as light blue

[0.6350 0.0780 0.1840] '#a2142f'

Sample of RGB triplet [0.6350 0.0780 0.1840], which appears as dark red

Example:[0.5 0.5 0.5]

Example:”blue'

Example:“# D2F9A7”

标记F一世ll color, specified as'汽车',,,,一种nRGB triplet, a hexadecimal color code, a color name, or a short name. The'汽车'v一种lue uses the same color as the<一种HreF="//www.tianjin-qmedu.com/au/help/symbolic/#bu008tv_sep_shared-MarkerEdgeColor" class="intrnllnk">标记EdgeColor财产。

对于自定义颜色,请指定RGB三重态或十六进制颜色代码。

  • RGB三重态是一个三元素行矢量,其元素指定了颜色的红色,绿色和蓝色组件的强度。强度必须在范围内[0,1]; for example,[0.4 0.6 0.7]

  • A hexadecimal color code is a character vector or a string scalar that starts with a hash symbol ()Followed by three or six hexadecimal digits, which can range from0toF。这v一种lues are not case sensitive. Thus, the color codes”#FF8800”,,,,'#ff8800',,,,”#F80”,,,,一种nd'#f80'是等效的。

另外,您可以按名称指定一些常见的颜色。该表列出了命名的颜色选项,等效的RGB三重态和十六进制颜色代码。

颜色名称 Short Name RGB三胞胎 十六进制的颜色代码 外貌
'红色的' 'r' [1 0 0] '#ff0000'

Sample of the color red

'绿色' ”g' [0 1 0] '#00ff00'

Sample of the color green

”blue' ”b' [0 0 1] '#0000FF'

蓝色样品

”cyan' ”c' [0 1 1] ”#00FFFF”

Sample of the color cyan

”magenta' ”m' [1 0 1] ”#FF00FF”

颜色洋红色样品

”yellow' 'y' [1 1 0] '#ffff00'

Sample of the color yellow

”black' ”k' [0 0 0] ”#000000”

Sample of the color black

'白色的' 'W' [1 1 1] '#ffffff'

颜色样品白色

'没有任何' 不适用 不适用 不适用 No color

Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB uses in many types of plots.

RGB三胞胎 十六进制的颜色代码 外貌
[0 0.4470 0.7410] ”#0072BD'

Sample of RGB triplet [0 0.4470 0.7410], which appears as dark blue

[0.8500 0.3250 0.0980] '#D95319'

Sample of RGB triplet [0.8500 0.3250 0.0980], which appears as dark orange

[0.9290 0.6940 0.1250] '#EDB120'

Sample of RGB triplet [0.9290 0.6940 0.1250], which appears as dark yellow

[0.4940 0.1840 0.5560] '#7E2F8E'

RGB三重态样品[0.4940 0.1840 0.5560]

[0.4660 0.6740 0.1880] ”#77AC30'

RGB三重态样品[0.4660 0.6740 0.1880],该样本如中等绿色

[0.3010 0.7450 0.9330] ”#4DBEEE'

Sample of RGB triplet [0.3010 0.7450 0.9330], which appears as light blue

[0.6350 0.0780 0.1840] '#a2142f'

Sample of RGB triplet [0.6350 0.0780 0.1840], which appears as dark red

Example:[0.3 0.2 0.1]

Example:'绿色'

Example:“# D2F9A7”

标记大小,,,,specified as a positive value in points, where 1 point = 1/72 of an inch.

Output Arguments

全部收缩

一个或多个对象,作为标量或向量返回。该对象是函数表面对象或参数化的网格对象,具体取决于图的类型。您可以使用这些对象查询和修改特定行的属性。有关详细信息,请参阅<一种HreF="//www.tianjin-qmedu.com/au/help/matlab/ref/matlab.graphics.function.functionsurface-properties.html">F你nctionSurface Properties一种nd<一种HreF="//www.tianjin-qmedu.com/au/help/matlab/ref/matlab.graphics.function.parameterizedfunctionsurface-properties.html">ParameterizedFunctionSurface Properties

算法

Fmesh分配符号变量<一种HreF="//www.tianjin-qmedu.com/au/help/symbolic/#bu008tv-f" class="intrnllnk">FX斧头一世s,,,,tHentHey轴,和<一种HreF="https://au.mathworks.com/help/symbolic/symvar.html">Symvar确定要分配的变量的顺序。因此,变量和轴名可能无法对应。强迫Fmesh分配Xoryto its corresponding axis, create the symbolic function to plot, then pass the symbolic function toFmesh

例如,以下代码绘制了网格F((X,,,,y)=罪((y)通过两种方式。第一种方式迫使海浪相对于y斧头一世s。这second way assignsyX斧头一世sbecause it is the first (and only) variable in the symbolic function.

symsXy; f(x,y) = sin(y); figure; subplot(2,1,1) fmesh(f); subplot(2,1,2) fmesh(f(x,y));%或fmesh(sin(y));

版本历史记录

在R2016a中引入