2017-05-19 4 views
3

Wie kann ich MarkerIndices mit plot verwenden?MATLAB plots MarkerIndices-Eigenschaft

x = linspace(-10,10,101); 
y = sin(x); 

plot(x, y, 'color', 'blue', ... 
      'LineStyle','-', ... 
      'Marker', 's', ...   
      'MarkerIndices', [1, 5, 10], ...   
      'MarkerEdgeColor', 'black',... 
      'MarkerFaceColor','yellow'); 

Fehlermeldung

Error using plot 
There is no MarkerIndices property on the Line class. 

Error in plotting3 (line 4) 
plot(x, y, 'color', 'blue', ... 
+0

Was ist die Version? – Masoud

+0

@Masoud, Version 2015a. – anonymous

Antwort

3

MarkerIndices wurde in R2016b Version verfügbar.

Die Abhilfe ist Plotten zweimal:

MarkerIndices = [1, 5, 10]; 
myplot = plot(x, y, 'b-.'); 
hold on;     
mymarkers = plot(x(MarkerIndices), y(MarkerIndices), 'ro');  
legend(myplot) 

Diese funktionieren sollte. Ich habe bemerkt, dass es sich um einen Beitrag in der MathWorks Community handelt. Stellt einen Link bereit, wenn er gefunden wurde.

P.S. Dies ist die LINK zur Antwort;