plotting information that is above a certain threshold

13 Ansichten (letzte 30 Tage)
Bran
Bran am 22 Jan. 2013
Kommentiert: Image Analyst am 14 Nov. 2016
If I have a dataset and I want to threshold it I use
thresh = find(dataset > 100)
however, if I want to plot 'thresh' how would I go about this as I know that the find function just gives the indicies at which these values occur.

Akzeptierte Antwort

Thorsten
Thorsten am 22 Jan. 2013
If you want to plot the data above threshold, you can use
dataset_new = dataset(find(dataset > 100));
plot(dataset_new)
  5 Kommentare
Image Analyst
Image Analyst am 14 Nov. 2016
Yes.
yourData(yourData < thresholdValue) = 0;
Image Analyst
Image Analyst am 14 Nov. 2016
You need to put dataset_new on the left hand side:
x = Data_Bushing1(:, 1); % import Y of column 1 from Data_Bushing1
x(x > -2 & x < 2) = 0; % set values in between threshold value to zeros
dataset_new = x;
stem(dataset_new)
x will already have the values in the threshold range zeroed out, which is what you want. So all you have to do is assign it to a new variable, if you even want a new variable. Otherwise you can just use x as-is.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by