A cycle for creating and working with zones

조회 수: 1 (최근 30일)
Lev Mihailov
Lev Mihailov 2019년 9월 3일
댓글: Lev Mihailov 2019년 9월 3일
Hello! I have a long vector line 1x10026, I need to divide it into zones (100 values ​​in each), look at them and do operations with them, and then again deplete it into a single vector line, help me how to do this
Data % my data is in the form of a row vector
for ind=1:100:n % n the length of this string
TF = isoutlier(Data(ind));
TF{i}=TF;
end
I tried this option, but does not consider the value.
1) How can I make these zones with 100 values ​​and what would the tail be considered (those are my 26 values) ???
2) How do I then impoverish them?
  댓글 수: 3
Lev Mihailov
Lev Mihailov 2019년 9월 3일
B = reshape(A,[100,100])
To RESHAPE the number of elements must not change.
is there such an error, or is it possible to make the system iterate over 10 values ​​and write them to the same array?
Lev Mihailov
Lev Mihailov 2019년 9월 3일
for ind=1:100 % n the length of this string
TF(ind) = isoutlier(Data(ind))
I try to do so, but only 100 values ​​come out

댓글을 달려면 로그인하십시오.

채택된 답변

Andrei Bobrov
Andrei Bobrov 2019년 9월 3일
n = numel(Data);
ii = ceil((1:n)'/100);
TF = accumarray(ii,Data(:),[],@(x){isoutlier(x)});

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by