How to find the longest and shortest section?

1 回表示 (過去 30 日間)
Lev Mihailov
Lev Mihailov 2019 年 8 月 23 日
コメント済み: Rik 2019 年 8 月 23 日
Hello! Here is my code
Data1=[12 121 122 12 12 12 12 12 12 12 63 65 70 70 70 70 71 12 12 12 12 12 12];
Data2=[20 21 20 21 21 90 92 93 90 93 90 59 30 102 30 21 22 23 21]';
n= lengthData1);
x = 1:n';
%Wscat=Data;
[TF,L,U,C] = isoutlier(Data1);
plot(x,Data1,x(TF),Data1(TF),'x',x,L*ones(1,n),x,U*ones(1,n),x,C*ones(1,n))
legend('Original Data','Outlier','Lower Threshold','Upper Threshold','Center Value')
Is it possible to select the longest queue separately in matlab?
TF=[0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 0 1]
I provided an example, I need the area with the largest number 1
help me how to do this and then where 1 put my values
  1 件のコメント
Rik
Rik 2019 年 8 月 23 日
You can find the longest run with a combination of diff, find, and max (by using its second output).

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by