How to find a mean value after each 360 degree?
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ilkin Abdullayev
le 20 Mai 2020
Commenté : Ilkin Abdullayev
le 22 Mai 2020
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 commentaires
darova
le 21 Mai 2020
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?
Réponse acceptée
darova
le 21 Mai 2020
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 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!