MATLAB绘图';s MarkerIndices属性
如何将MATLAB绘图';s MarkerIndices属性,matlab,plot,markers,Matlab,Plot,Markers,如何将MarkerIndices与plot一起使用 x = linspace(-10,10,101); y = sin(x); plot(x, y, 'color', 'blue', ... 'LineStyle','-', ... 'Marker', 's', ... 'MarkerIndices', [1, 5, 10], ... 'MarkerEdgeC
MarkerIndices
与plot
一起使用
x = linspace(-10,10,101);
y = sin(x);
plot(x, y, 'color', 'blue', ...
'LineStyle','-', ...
'Marker', 's', ...
'MarkerIndices', [1, 5, 10], ...
'MarkerEdgeColor', 'black',...
'MarkerFaceColor','yellow');
错误消息
Error using plot
There is no MarkerIndices property on the Line class.
Error in plotting3 (line 4)
plot(x, y, 'color', 'blue', ...
在R2016b版本中可用
该解决方案将打印两次:
MarkerIndices = [1, 5, 10];
myplot = plot(x, y, 'b-.');
hold on;
mymarkers = plot(x(MarkerIndices), y(MarkerIndices), 'ro');
legend(myplot)
这应该行得通。我评论说这是关于MathWorks社区的一篇文章。将提供一个链接,如果找到它
注:这是答案的 版本是什么?@Masoud,版本2015a。