Plotting specific data points from a vector/double

조회 수: 46 (최근 30일)
Matthew Peoples
Matthew Peoples 2021년 5월 11일
답변: Walter Roberson 2021년 5월 11일
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;

채택된 답변

Walter Roberson
Walter Roberson 2021년 5월 11일
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개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by