Plotting specific data points from a vector/double
30 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Matthew Peoples
le 11 Mai 2021
Réponse apportée : Walter Roberson
le 11 Mai 2021
Hello there,
I hage a 1 256 double/vector with a histogram distribution of values from 0 to 255 (representing the frequency of certain color pixels in a greyscale image). Essentially, I need to remove the plot points at 105 and 106 i.e. plot 1:104 and 107:255 on the same graph. Any ideas on how to do this? I am getting errors trying:
plot(face_orig(1:104, 107:255));
% I also tried below, but it didn't give the correct result
plot(face_orig(1:104)); hold on; plot(face_orig(107:225)); hold off;
0 commentaires
Réponse acceptée
Walter Roberson
le 11 Mai 2021
plot(face_orig([1:104, 107:255]));
However, this would give you a result as-if the entry at 107 were from 105. You should more likely do something like
x = [1:104, 107:255];
plot(x, face_orig(x))
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Line Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!