Clear Filters
Clear Filters

Plotting specific data points from a vector/double

26 views (last 30 days)
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;

Accepted Answer

Walter Roberson
Walter Roberson on 11 May 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))

More Answers (0)

Community Treasure Hunt

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

Start Hunting!