specifying the horizontal linetype '_' produces an error.

3 次查看(过去 30 天)
scatter3(x,y,z,'_')
produces:
Error using scatter3 (line 45)
Invalid color or line sytle.

采纳的回答

Steven Lord
Steven Lord 2020-9-21
The horizontal and vertical line markers for plots were introduced in release R2020b. If you're using an older release you will not be able to use them.
  3 个评论
madhan ravi
madhan ravi 2020-9-21
If you want to use 2020b version instantaneously, just use MATLAB Online.

请先登录,再进行评论。

更多回答(2 个)

Star Strider
Star Strider 2020-9-21
Function arguments in MATLAB are positional, so it is necessary to provide values for the interventing arguments to use later arguments.
This plots red horizontal lines at the appropriate places:
scatter3(x,y,z,[],'r','_')
.
  2 个评论
Bruce Wayne
Bruce Wayne 2020-9-21
Positioning does not change the error. Something is wrong with the markertype options within my MATLAB sowftware. The horizontal and vertical markertype options are producing errors.
For example, the following commands work:
scatter3(x,y,z,'+')
scatter3(x,y,z,'*')
scatter3(x,y,z,'x')
scatter3(x,y,z,'.')
however, the following two produce an error:
scatter3(x,y,z,'_')
scatter3(x,y,z,'|')
Star Strider
Star Strider 2020-9-21
The code I posted works correctly in R202b.
So does this:
figure
plot3(x,y,z,'_r')
grid
producing the same as the scatter3 call.
What version of MATLAB are you using? The online documentation is for R2020b, and may not be appropriate (or accurate) for all earlier versions.

请先登录,再进行评论。


Walter Roberson
Walter Roberson 2020-9-21
编辑:Walter Roberson 2020-9-21
horizontal line style is '-' not '_'
  2 个评论
Bruce Wayne
Bruce Wayne 2020-9-21
编辑:Walter Roberson 2020-9-21
see marker types
'_'Horizontal line
'|'Vertical line
horizontal line marker type is '_' not '-' !
Star Strider
Star Strider 2020-9-21
The '_' was new to me too. It may be new in R2020b. See markertype in the current (2020b) online documentation.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

标签

产品


版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by