How to find a mean value after each 360 degree?

조회 수: 7 (최근 30일)
Ilkin Abdullayev
Ilkin Abdullayev 2020년 5월 20일
댓글: Ilkin Abdullayev 2020년 5월 22일
Hello everyone,
I urgently need your help. I have a data 50000x5 and my 1 column is degree such as 1.5,1.45,2,1.35 and so on.
I need to calculate a mean value after each 360 degree for whole data but do not know how to do.
If anyone can help I would be very glad.
Thanks in advance.
  댓글 수: 4
darova
darova 2020년 5월 21일
Here is how i understand oyour question: You want to divide each cycle as following
My question: where is the points of breakup? 180? 360?
Ilkin Abdullayev
Ilkin Abdullayev 2020년 5월 21일
so, there is no known point for this purposes. Let me to explain.
In my data as you can see one column is the degree and for example if I do it in excel manualy, I sum up first 243 row (example) for angle and obtain 360 degree. Then next 360 degree is between 244 500 for example. The thing is the number of the rows that we need sum up for obtaining 360 degree is not the same always. So what I need, to find a mean value for each 360 degree. I hope now its clear.

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

채택된 답변

darova
darova 2020년 5월 21일
Try this
A = importdata('meanvalue.csv',',');
%%
B = cumsum(diff(A,2,1));
B(end+1,:) = -inf;
k = 1;
s = 1;
for i = 1:size(B,1)
if B(i,1) < -pi % end of cycle
s = s + 1; % group counter
A(k:i,3) = mean(A(k:i,2)); % calculate mean
A(k:i,4) = s; % assign group number
k = i; % index of next group
end
end
t = A(:,1);
r = cumsum(A(:,2));
[x,y] = pol2cart(t,r);
plot(x,y)
hold on
scatter(x,y,5,A(:,4),'fill')
hold off
  댓글 수: 7
Ilkin Abdullayev
Ilkin Abdullayev 2020년 5월 22일
Yes, I agree with you. Just take a look picture that I have upload. You can notice from the size of data and also I will leave the result that you can see it does not give the mean just change the values. I mean normally we must have one number as a mean for whole rows but there is no this number.
I obtain the same graph that you obtain and do not change anything even use for the same data but no mean value which must be 1 number.
Ilkin Abdullayev
Ilkin Abdullayev 2020년 5월 22일
Sorry, I just noticed one thing which is mean value. Thank a lot . I really appreaciate your support

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

추가 답변 (1개)

Ilkin Abdullayev
Ilkin Abdullayev 2020년 5월 20일
I am just leving my data you may have look

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by