Display Markers At Specific Data Points
71 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Tahir Afareen
il 18 Nov 2019
Modificato: Steven Lord
il 25 Ott 2023
Greetings
when i run this comman
plot(t_010_tbc_r_002,stress_010_01,'-o','MarkerIndices',1:10:length(stress_010_01))
it gives me this error
Error using plot
There is no MarkerIndices property on the Line class.
Error in Results (line 194)
plot(t_010_tbc_r_002,stress_010_01,'--o','MarkerIndices',1:10:length(stress_010_01))
reasons???
2 Commenti
Erivelton Gualter
il 18 Nov 2019
It does not seems to be wrong.
Run the following code and see if it works fine:
x = linspace(0,10);
y = sin(x);
plot(x,y,'-o','MarkerIndices',1:5:length(y))
Risposta accettata
Star Strider
il 18 Nov 2019
The MarkerIndices name-value pair is relatively new.
If you do not have it, it is straightforward to do that with a second plot call:
figure
plot(t_010_tbc_r_002,stress_010_01,'-b')
hold on
plot(t_010_tbc_r_002(idx),stress_010_01(idx),'ob')
hold off
Experiment to get different results.
2 Commenti
Più risposte (1)
the cyclist
il 18 Nov 2019
Modificato: Steven Lord
il 25 Ott 2023
The marker indices functionality was introduced in version R2016b. If you have an older version, then you'll get an error.
[SL: fixed typo in version number]
Vedere anche
Categorie
Scopri di più su Annotations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!